mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-08-28 04:46:50 -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>
28 lines
565 B
Go
28 lines
565 B
Go
//go:build windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/Microsoft/go-winio/pkg/etw"
|
|
)
|
|
|
|
func main() {
|
|
var pn = flag.String("provider-name", "", "The human readable ETW provider name to be converted into GUID format")
|
|
flag.Parse()
|
|
if pn == nil || *pn == "" {
|
|
fmt.Fprint(os.Stderr, "--provider-name is required")
|
|
os.Exit(1)
|
|
}
|
|
p, err := etw.NewProvider(*pn, nil)
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "failed to convert provider-name: '%s' with err: '%s", *pn, err)
|
|
os.Exit(1)
|
|
}
|
|
defer p.Close()
|
|
fmt.Fprintf(os.Stdout, "%s", p)
|
|
}
|