Here is a watered down example of the successful compilation and execution of a program with an unused variable. https://play.golang.org/p/v9KTDLYEal1. The "example" is redefined; it is not used after being redefined. While this program will run on the playground, it will not compile successfully on our Jenkins pipeline. Does the latest version of Go allow this behavior while older versions do not?
reference code: package main import "fmt" func main() { output := make(chan bool, 1) var example unusedStruct go func() { example = unusedStruct{} output <- true }() <-output fmt.Println("Hello, 世界") } type unusedStruct struct { } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.