Skip to content

Commit

Permalink
fix: security scanner warnings (#1611)
Browse files Browse the repository at this point in the history
* fix: security scanner warnings
* fix: GH actions

Signed-off-by: Sandor Szücs <[email protected]>
  • Loading branch information
szuecs authored Nov 18, 2020
1 parent e8c4ba7 commit 79de18d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ on:
push:
branches:
- master
env:
GO111MODULE: on
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2-beta
- uses: actions/setup-go@v2
with:
go-version: '^1.15'
- run: go version
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: pr
on: [pull_request]
env:
GO111MODULE: on
jobs:
check-race:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2-beta
- uses: actions/setup-go@v2
with:
go-version: '^1.15'
- run: go version
Expand All @@ -18,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2-beta
- uses: actions/setup-go@v2
with:
go-version: '^1.15'
- run: go version
Expand Down
2 changes: 1 addition & 1 deletion swarm/nodeinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewStaticNodeInfo(name, addr string) (*NodeInfo, error) {
return nil, err
}
ip := net.ParseIP(ipString)
portInt, err := strconv.Atoi(portString)
portInt, err := strconv.ParseUint(portString, 10, 16)
if err != nil {
return nil, fmt.Errorf("invalid port in addr '%s': %v", portString, err)
}
Expand Down
6 changes: 3 additions & 3 deletions tracing/tracers/basic/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func InitTracer(opts []string) (opentracing.Tracer, error) {
fmt.Printf("DO NOT USE IN PRODUCTION\n")
var dropAllLogs bool
var sampleModulo uint64 = 1
var maxLogsPerSpan int64 = 0
var maxLogsPerSpan int = 0
var recorder basic.SpanRecorder = basic.NewInMemoryRecorder()
var err error

Expand All @@ -37,7 +37,7 @@ func InitTracer(opts []string) (opentracing.Tracer, error) {
if len(parts) == 1 {
return nil, missingArg(parts[0])
}
maxLogsPerSpan, err = strconv.ParseInt(parts[1], 10, 64)
maxLogsPerSpan, err = strconv.Atoi(parts[1])
if err != nil {
return nil, invalidArg(parts[0], err)
}
Expand Down Expand Up @@ -70,7 +70,7 @@ func InitTracer(opts []string) (opentracing.Tracer, error) {
return basic.NewWithOptions(basic.Options{
DropAllLogs: dropAllLogs,
ShouldSample: func(traceID uint64) bool { return traceID%sampleModulo == 0 },
MaxLogsPerSpan: int(maxLogsPerSpan),
MaxLogsPerSpan: maxLogsPerSpan,
Recorder: recorder,
}), nil
}
Expand Down
6 changes: 3 additions & 3 deletions tracing/tracers/jaeger/jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func parseOptions(opts []string) (*config.Configuration, error) {
var samplerType string
var samplerURL string
var localAgent string
var reporterQueue int64
var reporterQueue int
var reporterInterval time.Duration
var globalTags []opentracing.Tag

Expand Down Expand Up @@ -70,7 +70,7 @@ func parseOptions(opts []string) (*config.Configuration, error) {
if len(parts) == 1 {
return nil, missingArg(parts[0])
}
reporterQueue, _ = strconv.ParseInt(parts[1], 10, 64)
reporterQueue, _ = strconv.Atoi(parts[1])
case "reporter-interval":
if len(parts) == 1 {
return nil, missingArg(parts[0])
Expand Down Expand Up @@ -105,7 +105,7 @@ func parseOptions(opts []string) (*config.Configuration, error) {
SamplingServerURL: samplerURL,
},
Reporter: &config.ReporterConfig{
QueueSize: int(reporterQueue),
QueueSize: reporterQueue,
BufferFlushInterval: reporterInterval,
LocalAgentHostPort: localAgent,
},
Expand Down

0 comments on commit 79de18d

Please sign in to comment.