Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v6
with:
version: v2.0.2
version: v2.1.0

gotest:
name: Run Tests
Expand Down
36 changes: 22 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
version: "2"
linters:
enable:
# golangci-lint defaults
# ref: https://golangci-lint.run/usage/linters/#enabled-by-default
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
# additional
- misspell
- gofmt
fast: true
run:
timeout: 5m
- misspell
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion commands/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,6 @@ func isGitHubEnvironment() bool {
// payloadFromCompactPkt extracts the payload from a compact PK Token which
// is always the second part of the '.' separated string.
func payloadFromCompactPkt(compactPkt []byte) []byte {
parts := bytes.SplitN(compactPkt, []byte("."), -1)
parts := bytes.Split(compactPkt, []byte("."))
return parts[1]
}
2 changes: 1 addition & 1 deletion commands/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func TestDetermineProvider(t *testing.T) {
} else {
require.NoError(t, err, "Unexpected error")
require.True(t, provider != nil || chooser != nil, "Provider or chooser should never both be nil")
require.True(t, !(provider != nil && chooser != nil), "Provider or chooser should never both be non-nil")
require.False(t, provider != nil && chooser != nil, "Provider or chooser should never both be non-nil")

if tt.wantIssuer != "" {
require.NotNil(t, provider)
Expand Down
2 changes: 1 addition & 1 deletion policy/plugins/plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func TestPolicyPluginsWithMock(t *testing.T) {
sub, _ := os.LookupEnv("OPKSSH_PLUGIN_SUB")
aud, _ := os.LookupEnv("OPKSSH_PLUGIN_AUD")

if "/usr/bin/local/opk/policy-cmd" == name {
if name == "/usr/bin/local/opk/policy-cmd" {

if len(arg) != 3 {
return nil, fmt.Errorf("expected 3 arguments, got %d", len(arg))
Expand Down
2 changes: 1 addition & 1 deletion policy/providerloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func NewProviderFileLoader() *ProvidersFileLoader {
}

func (o *ProvidersFileLoader) LoadProviderPolicy(path string) (*ProviderPolicy, error) {
content, err := o.FileLoader.LoadFileAtPath(path)
content, err := o.LoadFileAtPath(path)
if err != nil {
return nil, err
}
Expand Down
Loading