mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-08-31 06:16:46 -04:00
Some new upcoming changes require us to use Go 1.23. However, if we switch to Go 1.23 some new linter errors are showing up. This commit fixes most of the errors and adds an exclusion for integer overflow errors. Signed-off-by: Amit <ambarve@microsoft.com>
39 lines
885 B
Go
39 lines
885 B
Go
//go:build windows
|
|
|
|
package etw
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/Microsoft/go-winio/pkg/guid"
|
|
)
|
|
|
|
func mustGUIDFromString(t *testing.T, s string) guid.GUID {
|
|
t.Helper()
|
|
|
|
g, err := guid.FromString(s)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
return g
|
|
}
|
|
|
|
func Test_ProviderIDFromName(t *testing.T) {
|
|
type testCase struct {
|
|
name string
|
|
g guid.GUID
|
|
}
|
|
testCases := []testCase{
|
|
{"wincni", mustGUIDFromString(t, "c822b598-f4cc-5a72-7933-ce2a816d033f")},
|
|
{"Moby", mustGUIDFromString(t, "6996f090-c5de-5082-a81e-5841acc3a635")},
|
|
{"ContainerD", mustGUIDFromString(t, "2acb92c0-eb9b-571a-69cf-8f3410f383ad")},
|
|
{"Microsoft.Virtualization.RunHCS", mustGUIDFromString(t, "0B52781F-B24D-5685-DDF6-69830ED40EC3")},
|
|
}
|
|
for _, tc := range testCases {
|
|
g := providerIDFromName(tc.name)
|
|
if g != tc.g {
|
|
t.Fatalf("Incorrect provider GUID.\nExpected: %s\nActual: %s", tc.g, g)
|
|
}
|
|
}
|
|
}
|