You do not need to convert the string into a slice of bytes to use Write, you can just use the string directly.
Non-Compliant Code Examples
packagemainimport("fmt""math")funcmain(){n:=5.0aNaN:=math.NaN()// This case cannot be caught with current capabilities
ifn==aNaN{fmt.Println("hello")}elseifn>math.NaN(){fmt.Println("hi")}fmt.Println("goodbye")}
Seamless integrations. Try Datadog Code Analysis
Datadog Code Analysis
Try this rule and analyze your code with Datadog Code Analysis
How to use this rule
1
2
rulesets:- go-best-practices # Rules to enforce Go best practices.
Create a static-analysis.datadog.yml with the content above at the root of your repository
Use our free IDE Plugins or add Code Analysis scans to your CI pipelines