Skip to content

Commit

Permalink
Merge pull request #191 from articulate/style/perfsprint
Browse files Browse the repository at this point in the history
style(perfsprint): replace fmt.Sprintf with faster alternatives
  • Loading branch information
mloberg authored Feb 12, 2024
2 parents bbd4196 + b03376d commit 069d11f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- id: check-yaml
- id: no-commit-to-branch
- repo: https://github.com/golangci/golangci-lint
rev: v1.55.0
rev: v1.56.1
hooks:
- id: golangci-lint
- repo: https://github.com/syntaqx/git-hooks
Expand Down
4 changes: 2 additions & 2 deletions kms_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"context"
"fmt"
"errors"
"testing"

"github.com/aws/aws-sdk-go-v2/service/kms"
Expand Down Expand Up @@ -49,7 +49,7 @@ func TestDecodeToken(t *testing.T) {
t.Run("kms error", func(t *testing.T) {
m.On("Decrypt", context.TODO(), &kms.DecryptInput{
CiphertextBlob: []byte("foobar"),
}).Return("no", fmt.Errorf("kms error")) //nolint:goerr113
}).Return("no", errors.New("kms error")) //nolint:goerr113

token, err := decodeToken(context.TODO(), m, "Zm9vYmFy")
assert.Equal(t, "", token)
Expand Down
6 changes: 3 additions & 3 deletions utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"bytes"
"fmt"
"errors"
"os"
"os/exec"
"testing"
Expand Down Expand Up @@ -46,13 +46,13 @@ func TestLoadValues(t *testing.T) {
func TestLoadValues_Fatal(t *testing.T) {
if os.Getenv("TEST_FATAL") == "true" {
m := new(mockClient)
m.On("Load", "none").Return("", "", fmt.Errorf("test error")) //nolint:goerr113
m.On("Load", "none").Return("", "", errors.New("test error")) //nolint:goerr113

loadValues(m, zerolog.New(os.Stderr), []string{"none"})
return
}

cmd := exec.Command(os.Args[0], fmt.Sprintf("-test.run=%s", t.Name())) //nolint:gosec
cmd := exec.Command(os.Args[0], "-test.run="+t.Name()) //nolint:gosec
cmd.Env = append(cmd.Env, "TEST_FATAL=true")

var exit *exec.ExitError
Expand Down

0 comments on commit 069d11f

Please sign in to comment.