github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/internal/telemetry/telemetry.go (about)

     1  // Copyright 2024 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build !cmd_go_bootstrap
     6  
     7  // Package telemetry is a shim package around the golang.org/x/telemetry
     8  // and golang.org/x/telemetry/counter packages that has code build tagged
     9  // out for cmd_go_bootstrap so that the bootstrap Go command does not
    10  // depend on net (which is a dependency of golang.org/x/telemetry/counter
    11  // on Windows).
    12  package telemetry
    13  
    14  import (
    15  	"github.com/shogo82148/std/flag"
    16  
    17  	"golang.org/x/telemetry/counter"
    18  )
    19  
    20  // Start opens the counter files for writing if telemetry is supported
    21  // on the current platform (and does nothing otherwise).
    22  func Start()
    23  
    24  // StartWithUpload opens the counter files for writing if telemetry
    25  // is supported on the current platform and also enables a once a day
    26  // check to see if the weekly reports are ready to be uploaded.
    27  // It should only be called by cmd/go
    28  func StartWithUpload()
    29  
    30  func Inc(name string)
    31  
    32  func NewCounter(name string) *counter.Counter
    33  
    34  func CountFlags(prefix string, flagSet flag.FlagSet)