mirror of
https://github.com/juanfont/headscale.git
synced 2026-04-28 03:27:15 +02:00
all: fix golangci-lint issues (#3064)
This commit is contained in:
@@ -38,9 +38,10 @@ type buffer struct {
|
||||
|
||||
// Write appends the contents of p to the buffer, growing the buffer as needed. It returns
|
||||
// the number of bytes written.
|
||||
func (b *buffer) Write(p []byte) (n int, err error) {
|
||||
func (b *buffer) Write(p []byte) (int, error) {
|
||||
b.mutex.Lock()
|
||||
defer b.mutex.Unlock()
|
||||
|
||||
return b.store.Write(p)
|
||||
}
|
||||
|
||||
@@ -49,6 +50,7 @@ func (b *buffer) Write(p []byte) (n int, err error) {
|
||||
func (b *buffer) String() string {
|
||||
b.mutex.Lock()
|
||||
defer b.mutex.Unlock()
|
||||
|
||||
return b.store.String()
|
||||
}
|
||||
|
||||
@@ -66,7 +68,8 @@ func ExecuteCommand(
|
||||
}
|
||||
|
||||
for _, opt := range options {
|
||||
if err := opt(&execConfig); err != nil {
|
||||
err := opt(&execConfig)
|
||||
if err != nil {
|
||||
return "", "", fmt.Errorf("execute-command/options: %w", err)
|
||||
}
|
||||
}
|
||||
@@ -105,7 +108,6 @@ func ExecuteCommand(
|
||||
// log.Println("Command: ", cmd)
|
||||
// log.Println("stdout: ", stdout.String())
|
||||
// log.Println("stderr: ", stderr.String())
|
||||
|
||||
return stdout.String(), stderr.String(), fmt.Errorf("command failed, stderr: %s: %w", stderr.String(), ErrDockertestCommandFailed)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user