Browse Source

fix: incorrect struct tag and WaitGroup usage (#6649)

* remove duplicated json tag

* fix: incorrect wait group usage
rerorero 4 months ago
parent
commit
86c8e48dd9
2 changed files with 3 additions and 5 deletions
  1. 1 1
      agent/config/config.go
  2. 2 4
      command/debug/debug.go

+ 1 - 1
agent/config/config.go

@@ -610,7 +610,7 @@ type Performance struct {
 
 type Telemetry struct {
 	CirconusAPIApp                     *string  `json:"circonus_api_app,omitempty" hcl:"circonus_api_app" mapstructure:"circonus_api_app"`
-	CirconusAPIToken                   *string  `json:"circonus_api_token,omitempty" json:"-" hcl:"circonus_api_token" mapstructure:"circonus_api_token" json:"-"`
+	CirconusAPIToken                   *string  `json:"circonus_api_token,omitempty" hcl:"circonus_api_token" mapstructure:"circonus_api_token"`
 	CirconusAPIURL                     *string  `json:"circonus_api_url,omitempty" hcl:"circonus_api_url" mapstructure:"circonus_api_url"`
 	CirconusBrokerID                   *string  `json:"circonus_broker_id,omitempty" hcl:"circonus_broker_id" mapstructure:"circonus_broker_id"`
 	CirconusBrokerSelectTag            *string  `json:"circonus_broker_select_tag,omitempty" hcl:"circonus_broker_select_tag" mapstructure:"circonus_broker_select_tag"`

+ 2 - 4
command/debug/debug.go

@@ -428,9 +428,8 @@ func (c *cmd) captureDynamic() error {
 					s = 1
 				}
 
+				wgProf.Add(1)
 				go func() {
-					wgProf.Add(1)
-
 					prof, err := c.client.Debug().Profile(int(s))
 					if err != nil {
 						errCh <- err
@@ -444,9 +443,8 @@ func (c *cmd) captureDynamic() error {
 					wgProf.Done()
 				}()
 
+				wgProf.Add(1)
 				go func() {
-					wgProf.Add(1)
-
 					trace, err := c.client.Debug().Trace(int(s))
 					if err != nil {
 						errCh <- err