delve/cmd/dlv/main.go

26 lines
546 B
Go
Raw Normal View History

2014-05-20 21:29:01 +00:00
package main
import (
"os"
"github.com/go-delve/delve/cmd/dlv/cmds"
"github.com/go-delve/delve/pkg/version"
"github.com/sirupsen/logrus"
)
2015-12-13 21:51:11 +00:00
// Build is the git sha of this binaries build.
var Build string
func main() {
if Build != "" {
version.DelveVersion.Build = Build
}
const cgoCflagsEnv = "CGO_CFLAGS"
if os.Getenv(cgoCflagsEnv) == "" {
os.Setenv(cgoCflagsEnv, "-O -g")
} else {
logrus.WithFields(logrus.Fields{"layer": "dlv"}).Warnln("CGO_CFLAGS already set, Cgo code could be optimized.")
}
cmds.New(false).Execute()
}