Skip to content
Open
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
5 changes: 3 additions & 2 deletions internal/credman/credman_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
package credman

import (
syscall "golang.org/x/sys/windows"
"reflect"
"time"
"unsafe"

syscall "golang.org/x/sys/windows"
)

// Load the Windows DLL "advapi32.dll", then set up Go wrapper functions for
Expand Down Expand Up @@ -78,7 +79,7 @@ func EnumerateCredentials(filter string, all bool) ([]*Credential, error) {
Len: count,
Cap: count,
}))
credentials := make([]*Credential, count, count)
credentials := make([]*Credential, count)
for i, c := range systemCredentials {
credentials[i] = convertFromSystemCredential(c)
}
Expand Down
7 changes: 4 additions & 3 deletions internal/credman/credman_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
package credman

import (
"github.com/stretchr/testify/assert"
"testing"
"time"

"github.com/stretchr/testify/assert"
)

func TestWriteCredential(t *testing.T) {
Expand All @@ -31,7 +32,7 @@ func TestWriteCredential(t *testing.T) {
assert.Equal(t, credentials[0].Persist, PersistSession, "WriteCredential wrote incorrect Persist, got: %d, want: %d", credentials[0].Persist, PersistSession)

// Cleanup the written credential
DeleteCredential(credential, CredTypeGeneric)
_ = DeleteCredential(credential, CredTypeGeneric)
}

func TestDeleteCredential(t *testing.T) {
Expand All @@ -44,7 +45,7 @@ func TestDeleteCredential(t *testing.T) {
}

// Write the credential first
WriteCredential(credential, CredTypeGeneric)
_ = WriteCredential(credential, CredTypeGeneric)

err := DeleteCredential(credential, CredTypeGeneric)
assert.NoErrorf(t, err, "DeleteCredential returned an error: %v", err)
Expand Down
6 changes: 3 additions & 3 deletions internal/io/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
package file

import (
"github.com/microsoft/go-sqlcmd/internal/io/folder"
"io/ioutil"
"os"
"path/filepath"

"github.com/microsoft/go-sqlcmd/internal/io/folder"
)

func CloseFile(f *os.File) {
Expand Down Expand Up @@ -55,7 +55,7 @@ func Exists(filename string) (exists bool) {
}

func GetContents(filename string) string {
b, err := ioutil.ReadFile(filename)
b, err := os.ReadFile(filename)
checkErr(err)

return string(b)
Expand Down
Loading