I think I'm facing a similar issue. This program:
// Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
// See page 4.
//!+
// Echo1 prints its command-line arguments.
package main
import (
"fmt"
"os"
)
func main() {
var s, sep string
for i := 1; i < len(os.Args); i++ {
s += sep + os.Args[i]
sep = " "
}
fmt.Println(s)
}
//!-
runs normally like this:
> go run main.go one two three
one two three
But when I modify it to debug the sep variable:
package main
import (
"fmt"
"os"
)
func main() {
var s, sep string
fmt.Println("{", sep, "}")
for i := 1; i < len(os.Args); i++ {
fmt.Println("<", sep, ">")
s += sep + os.Args[i]
sep = " "
}
fmt.Println(s)
}
then I get this:
PS C:\Users\Ricardo\Documents\workspace\go\rdirani\gopl.io\ch1\echo1> go run echo1.go one two three
fork/exec C:\Users\Ricardo\AppData\Local\Temp\go-build1657779692\b001\exe\echo1.exe: Access is denied.
And Kaspersky records this:
Event: Application placed in restricted group
Component: Application Control
Name: VHO:Backdoor.MSIL.Crysan.gen
Object name: Untrusted
Reason: Detected: VHO:Backdoor.MSIL.Crysan.gen
and it doesn't give me any option to report this as a false positive.
Interestingly, if I build it, it doesn't get flagged:
PS C:\Users\Ricardo\Documents\workspace\go\rdirani\gopl.io\ch1\echo1> ./echo1 one two three
{ }
< >
< >
< >
one two three