Skip to content

Commit

Permalink
Merge pull request docker#273 from thaJeztah/gofumpt
Browse files Browse the repository at this point in the history
format code with gofumpt
  • Loading branch information
thaJeztah committed May 27, 2023
2 parents a001d63 + 9817a23 commit 4ede49c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
8 changes: 4 additions & 4 deletions credentials/credentials_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (m *memoryStore) Get(serverURL string) (string, string, error) {
}

func (m *memoryStore) List() (map[string]string, error) {
//Simply a placeholder to let memoryStore be a valid implementation of Helper interface
// Simply a placeholder to let memoryStore be a valid implementation of Helper interface
return nil, nil
}

Expand Down Expand Up @@ -235,14 +235,14 @@ func TestEraseMissingServerURL(t *testing.T) {
}

func TestList(t *testing.T) {
//This tests that there is proper input an output into the byte stream
//Individual stores are very OS specific and have been tested in osxkeychain and secretservice respectively
// This tests that there is proper input an output into the byte stream
// Individual stores are very OS specific and have been tested in osxkeychain and secretservice respectively
out := new(bytes.Buffer)
h := newMemoryStore()
if err := List(h, out); err != nil {
t.Fatal(err)
}
//testing that there is an output
// testing that there is an output
if out.Len() == 0 {
t.Fatalf("expected output in the writer, got %d", 0)
}
Expand Down
1 change: 1 addition & 0 deletions osxkeychain/osxkeychain_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package osxkeychain
#include <stdlib.h>
*/
import "C"

import (
"errors"
"strconv"
Expand Down
11 changes: 6 additions & 5 deletions pass/pass.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ type Pass struct{}
// Ideally these would be stored as members of Pass, but since all of Pass's
// methods have value receivers, not pointer receivers, and changing that is
// backwards incompatible, we assume that all Pass instances share the same configuration

// initializationMutex is held while initializing so that only one 'pass'
// round-tripping is done to check pass is functioning.
var initializationMutex sync.Mutex
var passInitialized bool
var (
// initializationMutex is held while initializing so that only one 'pass'
// round-tripping is done to check pass is functioning.
initializationMutex sync.Mutex
passInitialized bool
)

// CheckInitialized checks whether the password helper can be used. It
// internally caches and so may be safely called multiple times with no impact
Expand Down
1 change: 1 addition & 0 deletions secretservice/secretservice_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package secretservice
#include <stdlib.h>
*/
import "C"

import (
"errors"
"unsafe"
Expand Down
1 change: 0 additions & 1 deletion secretservice/secretservice_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func TestSecretServiceHelper(t *testing.T) {
// remove them as they probably come from a previous failed test
for k, v := range oldAuths {
if strings.Compare(k, creds.ServerURL) == 0 && strings.Compare(v, creds.Username) == 0 {

if err := helper.Delete(creds.ServerURL); err != nil {
t.Fatal(err)
}
Expand Down
6 changes: 3 additions & 3 deletions wincred/wincred_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ func exactMatch(serverURL, target url.URL) bool {
}

func approximateMatch(serverURL, target url.URL) bool {
//if scheme is missing assume it is the same as target
// if scheme is missing assume it is the same as target
if serverURL.Scheme == "" {
serverURL.Scheme = target.Scheme
}
//if port is missing assume it is the same as target
// if port is missing assume it is the same as target
if serverURL.Port() == "" && target.Port() != "" {
serverURL.Host = serverURL.Host + ":" + target.Port()
}
//if path is missing assume it is the same as target
// if path is missing assume it is the same as target
if serverURL.Path == "" {
serverURL.Path = target.Path
}
Expand Down

0 comments on commit 4ede49c

Please sign in to comment.