Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
fix(lint): remove deprecated golint
Browse files Browse the repository at this point in the history
Signed-off-by: jaellio <[email protected]>
  • Loading branch information
jaellio committed Sep 20, 2021
1 parent b333ad5 commit c3bfaf4
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ linters:
- gocyclo
- gofmt
- goimports
- golint
- gosec
- govet
- misspell
- revive
- unused
- whitespace

Expand All @@ -27,12 +27,12 @@ issues:
exclude-rules:
# Ignore error for ginkgo and gomega dot imports
- linters:
- golint
- revive
source: ". \"github.com/onsi/(ginkgo|gomega)\""
text: "dot imports"
# Ignore error for test framework imports
- linters:
- golint
- revive
source: ". \"github.com/openservicemesh/osm/tests/framework\""
text: "dot imports"
# Exclude staticcheck messages for deprecated function, variable or constant
Expand Down
2 changes: 1 addition & 1 deletion mockspec/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
defer rulesfile.Close() //nolint: gosec,go-lint,errcheck
defer rulesfile.Close() //nolint: gosec,errcheck

scanner := bufio.NewScanner(rulesfile)
for scanner.Scan() {
Expand Down
4 changes: 3 additions & 1 deletion pkg/bugreport/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ func runCmdAndWriteToFile(cmdList []string, outFile string) error {
if err != nil {
return err
}
defer outfile.Close() //nolint: errcheck, #nosec G307
//nolint: errcheck
//#nosec G307
defer outfile.Close()
cmd.Stdout = outfile
cmd.Stderr = outfile

Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ func TestNamespaceErr(t *testing.T) {
// doesn't matter, this was just the simplest way to force an error to
// occur. Users of this package are not able to do this, but the resulting
// behavior is the same as if any other error had occurred.
kConfigPath := "This doesn't even look like a valid path name"
env.config.KubeConfig = &kConfigPath
configPath := "This doesn't even look like a valid path name"
env.config.KubeConfig = &configPath

tassert.Equal(t, env.Namespace(), "osm-system")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/kube/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var _ endpoint.Provider = (*client)(nil)
var _ service.Provider = (*client)(nil)

// NewClient returns a client that has all components necessary to connect to and maintain state of a Kubernetes cluster.
func NewClient(kubeController k8s.Controller, configClient config.Controller, cfg configurator.Configurator) *client { //nolint:golint // exported func returns unexported type
func NewClient(kubeController k8s.Controller, configClient config.Controller, cfg configurator.Configurator) *client { //nolint: revive // unexported-return
return &client{
kubeController: kubeController,
configClient: configClient,
Expand Down
2 changes: 1 addition & 1 deletion pkg/ticker/ticker.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type ResyncTicker struct {
var (
log = logger.New("ticker")
// Local reference to global ticker
rTicker *ResyncTicker = nil
rTicker *ResyncTicker
)

// InitTicker initializes a global ticker that is configured via
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_permissive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func testPermissiveMode(withSourceKubernetesService bool) {
const sourceNs = "client"
const destNs = "server"
const extSourceNs = "ext-client"
var meshNs []string = []string{sourceNs, destNs}
var meshNs = []string{sourceNs, destNs}

It("Tests HTTP traffic for client pod -> server pod with permissive mode", func() {
// Install OSM
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_trafficsplit_recursive_split.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func testRecursiveTrafficSplit(appProtocol string) {
}

var results HTTPMultipleResults
var serversSeen map[string]bool = map[string]bool{} // Just counts unique servers seen
var serversSeen = map[string]bool{} // Just counts unique servers seen
success := Td.WaitForRepeatedSuccess(func() bool {
curlSuccess := true

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_trafficsplit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func testTrafficSplit(appProtocol string, permissiveMode bool) {
}

var results HTTPMultipleResults
var serversSeen map[string]bool = map[string]bool{} // Just counts unique servers seen
var serversSeen = map[string]bool{} // Just counts unique servers seen
success := Td.WaitForRepeatedSuccess(func() bool {
curlSuccess := true

Expand Down
2 changes: 1 addition & 1 deletion tests/framework/common_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ func (td *OsmTestData) waitForOSMControlPlane(timeout time.Duration) error {
waitGroup.Wait()

if errController != nil || errInjector != nil {
return errors.New(fmt.Sprintf("OSM Control plane was not ready in time (%v, %v, %v)", errController, errInjector, errBootstrap))
return fmt.Errorf("OSM Control plane was not ready in time (%v, %v, %v)", errController, errInjector, errBootstrap)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion tests/framework/common_traffic.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (td *OsmTestData) GRPCRequest(req GRPCRequestDef) GRPCRequestResult {
// MapCurlOuput maps stdout from our specific curl,
// it expects headers on stdout like "<name>: <value...>"
func mapCurlOuput(curlOut string) map[string]string {
var ret map[string]string = make(map[string]string)
var ret = make(map[string]string)
scanner := bufio.NewScanner(strings.NewReader(curlOut))

for scanner.Scan() {
Expand Down

0 comments on commit c3bfaf4

Please sign in to comment.