如果我在Go语言中有这样的代码:
package main
import "fmt"
import "log"
func main() {
fmt.Println("hello world")
log.Println("log hello world")
}
是否可以在不更改源代码的情况下运行该程序来抑制日志输出,并从命令行传递标志或env变量,例如QUIET=1 go run hello
?
如果我在Go语言中有这样的代码:
package main
import "fmt"
import "log"
func main() {
fmt.Println("hello world")
log.Println("log hello world")
}
是否可以在不更改源代码的情况下运行该程序来抑制日志输出,并从命令行传递标志或env变量,例如QUIET=1 go run hello
?