Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format code with gofumpt #273

Merged
merged 1 commit into from
May 27, 2023
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
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