Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Weiße <[email protected]>
  • Loading branch information
daniel-weisse committed Aug 15, 2024
1 parent 5843458 commit 1d9551e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions coordinator/store/wrapper/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s Wrapper) GetIterator(prefix string) (Iterator, error) {
func (s Wrapper) GetActivations(marbleType string) (uint, error) {
request := strings.Join([]string{request.Activations, marbleType}, ":")
rawActivations, err := s.store.Get(request)
if errors.Is(store.ErrValueUnset, err) {
if errors.Is(err, store.ErrValueUnset) {
return 0, nil
} else if err != nil {
return 0, err
Expand All @@ -68,7 +68,7 @@ func (s Wrapper) GetActivations(marbleType string) (uint, error) {
// IncrementActivations is a wrapper for get/put activations to increment the value for one marble.
func (s Wrapper) IncrementActivations(marbleType string) error {
activations, err := s.GetActivations(marbleType)
if err != nil && !errors.Is(store.ErrValueUnset, err) {
if err != nil && !errors.Is(err, store.ErrValueUnset) {
return err
}
activations++
Expand Down
8 changes: 4 additions & 4 deletions marble/premain/premain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ func TestPreMain(t *testing.T) {

issuer := quote.NewMockIssuer()

require.NoError(os.Setenv(config.CoordinatorAddr, "addr"))
require.NoError(os.Setenv(config.Type, "type"))
require.NoError(os.Setenv(config.UUIDFile, "uuidfile"))
require.NoError(os.Setenv(config.DNSNames, "dns1,dns2"))
t.Setenv(config.CoordinatorAddr, "addr")
t.Setenv(config.Type, "type")
t.Setenv(config.UUIDFile, "uuidfile")
t.Setenv(config.DNSNames, "dns1,dns2")

// Actual tests follow.

Expand Down
4 changes: 2 additions & 2 deletions util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestMustGetenv(t *testing.T) {
const name = "EDG_TEST_MUST_GETENV"
const value = "foo"

assert.NoError(os.Setenv(name, value))
t.Setenv(name, value)
assert.Equal(value, MustGetenv(name))
assert.NoError(os.Unsetenv(name))
}
Expand All @@ -50,7 +50,7 @@ func TestGetenv(t *testing.T) {
}
for _, test := range tests {
if test.set {
assert.NoError(os.Setenv(test.envname, test.value))
t.Setenv(test.envname, test.value)
}
assert.Equal(test.result, Getenv(test.envname, test.fallback))
assert.NoError(os.Unsetenv(test.envname))
Expand Down

0 comments on commit 1d9551e

Please sign in to comment.