Skip to content

Commit

Permalink
squash pkg golang errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-mwangi committed Jul 24, 2023
1 parent 51f5585 commit 42efe3d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion examples/postgres-query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import (
"fmt"
"os"

"github.com/hypertrace/goagent/instrumentation/hypertrace/github.com/jackc/hyperpgx"
// gosec complains about this pkg not following golang repo standards
// "could not import github.com/hypertrace/goagent/instrumentation/hypertrace/github.com/jackc/hyperpgx (invalid package name: "")"
// It is caused the pkg having its own go.mod
"github.com/hypertrace/goagent/instrumentation/hypertrace/github.com/jackc/hyperpgx" // #nosec
)

func main() {
Expand Down
4 changes: 3 additions & 1 deletion examples/sql-query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import (
"net/http"
"time"

"github.com/go-sql-driver/mysql"
// gosec complains about github.com/go-sql-driver/mysql not following golang repo standards
// "could not import github.com/go-sql-driver/mysql (invalid package name: "")"
"github.com/go-sql-driver/mysql" // #nosec
"github.com/gorilla/mux"
"github.com/hypertrace/goagent/config"
"github.com/hypertrace/goagent/instrumentation/hypertrace"
Expand Down
6 changes: 4 additions & 2 deletions instrumentation/opencensus/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ func Init(cfg *config.AgentConfig) func() {

client := &http.Client{Transport: &http.Transport{
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: !cfg.GetReporting().GetSecure().GetValue(), // #nosec
MinVersion: tls.VersionTLS12,
// Ignore gosec: G402 (CWE-295): TLS InsecureSkipVerify may be true.
// #nosec G402

Check warning on line 26 in instrumentation/opencensus/init.go

View check run for this annotation

Codecov / codecov/patch

instrumentation/opencensus/init.go#L24-L26

Added lines #L24 - L26 were not covered by tests
InsecureSkipVerify: !cfg.GetReporting().GetSecure().GetValue(),
},
}}

Expand Down

0 comments on commit 42efe3d

Please sign in to comment.