Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staticcheck cleanup #4751

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0d13208
unnecessary use of fmt.Sprintf (S1039)
vytautas-karpavicius Feb 22, 2022
5ed4aee
could eliminate this type assertion (S1034)
vytautas-karpavicius Feb 22, 2022
b2d393a
package is being imported more than once (ST1019)
vytautas-karpavicius Feb 22, 2022
de43cb0
redundant return statement (S1023)
vytautas-karpavicius Feb 22, 2022
aff55fc
should use make(...) instead (S1019)
vytautas-karpavicius Feb 22, 2022
bf3a603
should omit nil check; len() for nil slices is defined as zero (S1009)
vytautas-karpavicius Feb 22, 2022
b12ec6e
should merge variable declaration with assignment on next line (S1021)
vytautas-karpavicius Feb 22, 2022
71dc77f
should use fmt.Fprintf instead of fmt.Fprint(fmt.Sprintf(...)) (S1038)
vytautas-karpavicius Feb 22, 2022
ab75516
hould replace this if statement with an unconditional strings.TrimPre…
vytautas-karpavicius Feb 22, 2022
b80849d
should use bytes.Equal(data, data2) instead (S1004)
vytautas-karpavicius Feb 22, 2022
e1f8e61
should use 'return X' instead of 'if X { return true }; return false'…
vytautas-karpavicius Feb 22, 2022
a03daba
should omit comparison to bool constant, can be simplified to trees[b…
vytautas-karpavicius Feb 22, 2022
f74777a
should replace loop with ancestors = append(ancestors, branchInfo.Anc…
vytautas-karpavicius Feb 22, 2022
aecde22
should use a simple channel send/receive instead of select with a sin…
vytautas-karpavicius Feb 22, 2022
9d59bd8
value of type int cannot be used with binary.Write (SA1003)
vytautas-karpavicius Feb 22, 2022
aaf593a
do not pass a nil Context, even if a function permits it; pass contex…
vytautas-karpavicius Feb 22, 2022
d6ffdbd
Using a deprecated function, variable, constant or field (SA1019)
vytautas-karpavicius Feb 22, 2022
e6d8a74
should not use built-in type string as key for value; define your own…
vytautas-karpavicius Feb 22, 2022
030d974
removed unused code (U1000)
vytautas-karpavicius Feb 23, 2022
4d895a9
error strings should not be capitalized (ST1005)
vytautas-karpavicius Feb 23, 2022
64384eb
don't use unit-specific suffix Seconds (ST1011)
vytautas-karpavicius Feb 23, 2022
f1350d4
should use time.Since instead of time.Now().Sub (S1012)
vytautas-karpavicius Feb 23, 2022
30bf124
should use time.Until instead of t.Sub(time.Now()) (S1024)
vytautas-karpavicius Feb 23, 2022
a1e55db
this value of ... is never used (SA4006)
vytautas-karpavicius Feb 24, 2022
7158bb6
Fixing integration test
vytautas-karpavicius Feb 24, 2022
c00d8b6
Fix TestDNSSRVMode
vytautas-karpavicius Feb 24, 2022
581a610
Merge branch 'master' into staticcheck-cleanup
vytautas-karpavicius Feb 24, 2022
952f9dd
Fix TestExecutionFixerActivity_Success
vytautas-karpavicius Feb 24, 2022
fd03d0d
Merge branch 'staticcheck-cleanup' of github.com:vytautas-karpavicius…
vytautas-karpavicius Feb 24, 2022
ce4e2cd
Use int64 for binary.Write
vytautas-karpavicius Feb 25, 2022
25e371f
Update service/frontend/clusterRedirectionHandler_test.go
vytautas-karpavicius Feb 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
should use fmt.Fprintf instead of fmt.Fprint(fmt.Sprintf(...)) (S1038)
  • Loading branch information
vytautas-karpavicius committed Feb 22, 2022
commit 71dc77f0d73d2e8926e6398b10c76254a6b140a9
4 changes: 2 additions & 2 deletions service/matching/matchingEngine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func (s *matchingEngineSuite) TasksHandler(w http.ResponseWriter, r *http.Reques
s.Lock()
defer s.Unlock()
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
fmt.Fprint(w, fmt.Sprintf("%v\n", s.taskManager))
fmt.Fprint(w, fmt.Sprintf("%v\n", s.matchingEngine))
fmt.Fprintf(w, "%v\n", s.taskManager)
fmt.Fprintf(w, "%v\n", s.matchingEngine)
}

func (s *matchingEngineSuite) TearDownSuite() {
Expand Down
2 changes: 1 addition & 1 deletion tools/cli/adminDBScanCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func AdminDBScanUnsupportedWorkflow(c *cli.Context) {
defer outputFile.Close()
for i := startShardID; i <= endShardID; i++ {
listExecutionsByShardID(c, i, rps, outputFile)
fmt.Println(fmt.Sprintf("Shard %v scan operation is completed.", i))
fmt.Printf("Shard %v scan operation is completed.\n", i)
}
}

Expand Down