Merge pull request #2203 from fidencio/wip/fix-static-checks

runtime: Fix lint issues
This commit is contained in:
Fabiano Fidêncio 2021-07-10 10:43:33 +02:00 committed by GitHub
commit 75356967c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -73,7 +73,7 @@ func init() {
var err error var err error
fmt.Printf("INFO: creating test directory\n") fmt.Printf("INFO: creating test directory\n")
testDir, err = ioutil.TempDir("", fmt.Sprintf("shimV2-")) testDir, err = ioutil.TempDir("", "shimV2-")
if err != nil { if err != nil {
panic(fmt.Sprintf("ERROR: failed to create test directory: %v", err)) panic(fmt.Sprintf("ERROR: failed to create test directory: %v", err))
} }

View File

@ -428,9 +428,7 @@ func HybridVSockDialer(sock string, timeout time.Duration) (net.Conn, error) {
// just for tests use. // just for tests use.
func MockHybridVSockDialer(sock string, timeout time.Duration) (net.Conn, error) { func MockHybridVSockDialer(sock string, timeout time.Duration) (net.Conn, error) {
if strings.HasPrefix(sock, "mock:") { sock = strings.TrimPrefix(sock, "mock:")
sock = strings.TrimPrefix(sock, "mock:")
}
dialFunc := func() (net.Conn, error) { dialFunc := func() (net.Conn, error) {
return net.DialTimeout("unix", sock, timeout) return net.DialTimeout("unix", sock, timeout)

View File

@ -57,6 +57,7 @@ func (b Builder) Add(elems ...int) {
// Result returns the result CPUSet containing all elements that were // Result returns the result CPUSet containing all elements that were
// previously added to this builder. Subsequent calls to Add have no effect. // previously added to this builder. Subsequent calls to Add have no effect.
func (b Builder) Result() CPUSet { func (b Builder) Result() CPUSet {
// nolint: staticcheck
b.done = true b.done = true
return b.result return b.result
} }