Skip to content

Commit

Permalink
Fix golangci-lint install and linting errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarocabanas committed Feb 13, 2024
1 parent 8a7f764 commit 1628a1f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GO_VERSION = $(shell go version | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
GOTOOLS = github.com/axw/gocov/gocov \
github.com/AlekSi/gocov-xml

GOLANGCILINT_VERSION = v1.24.0
GOLANGCILINT_VERSION = v1.56.0
GOLANGCILINT_BIN = bin/golangci-lint

# Temporary patch to avoid build failing because of the outdated documentation example
Expand All @@ -24,7 +24,7 @@ bin:
.PHONY: tools/golangci-lint
tools/golangci-lint:
@echo "installing GolangCI lint"
@(wget -qO - https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s $(GOLANGCILINT_VERSION) )
@(wget -qO - https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s $(GOLANGCILINT_VERSION) )


.PHONY: tools
Expand Down
12 changes: 6 additions & 6 deletions args/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ func underscore(s string) string {
// fields it defines. Each of the fields in the struct can define their defaults
// and help string by using tags:
//
// type Arguments struct {
// DefaultArgumentList
// Argument1 bool `default:"false" help:"This is the help we will print"`
// Argument2 int `default:"1" help:"This is the help we will print"`
// Argument3 string `default:"value" help:"This is the help we will print"`
// }
// type Arguments struct {
// DefaultArgumentList
// Argument1 bool `default:"false" help:"This is the help we will print"`
// Argument2 int `default:"1" help:"This is the help we will print"`
// Argument3 string `default:"value" help:"This is the help we will print"`
// }
//
// The fields in the struct will be populated with the values set either from
// the command line or from environment variables.
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial-code-v3/multiple-entities/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func queryAttrRedisInfo(query string, port int) (string, string) {
return strings.TrimSpace(splittedLine[0]), strings.TrimSpace(splittedLine[1])
}

// nolint: typecheck
func main() {
// Create Integration
i, err := integration.New(integrationName, integrationVersion, integration.Args(&args))
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial-code-v3/single-entity/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func queryRedisConfig(query string) (string, string) {
return splittedLine[0], splittedLine[1]
}

// nolint: typecheck
func main() {
// Create Integration
i, err := integration.New(integrationName, integrationVersion, integration.Args(&args))
Expand Down
2 changes: 1 addition & 1 deletion integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ func Test_Integration_FindEntity(t *testing.T) {
assert.True(t, e.SameAs(e1))
}

//--- helpers
// --- helpers
func newTestIntegration(t *testing.T) *Integration {
i, err := New(integrationName, integrationVersion, Logger(log.Discard), Writer(ioutil.Discard))
assert.NoError(t, err)
Expand Down
1 change: 1 addition & 0 deletions jmx/jmx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func TestOpenURL(t *testing.T) {
assert.Equal(t, "sample.url", lastArg)
}

// nolint: goconst
func TestQuery(t *testing.T) {
for q, isErr := range query2IsErr {
require.NoError(t, openWait("", "", "", "", openAttempts), "error on opening for query %s", q)
Expand Down
4 changes: 3 additions & 1 deletion jmx/jmx_unix.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
//go:build linux || darwin
// +build linux darwin

/*
Package jmx is a library to get metrics through JMX. It requires additional
setup. Read https://github.com/newrelic/infra-integrations-sdk#jmx-support for
instructions. */
instructions.
*/
package jmx

const (
Expand Down

0 comments on commit 1628a1f

Please sign in to comment.