import ( "testing" . "gopkg.in/check.v1" ) func Test(t *testing.T) { TestingT(t) } type MySuite struct{} var _ = Suite(&MySuite{}) func (s *MySuite) TestLog(c *C) { c.Logf("This is a log message") }
package main import ( "fmt" "log" ) func main() { log.SetPrefix("INFO: ") log.SetFlags(log.Ldate | log.Ltime) log.Println("This is an info message") log.Fatalf("This is a fatal message") }In this example, we use the standard Go log package to set the log prefix and flags. We then log an info message using log.Println() and a fatal message using log.Fatalf(). The gopkg.in.check.v1 C Logf is a part of the "check" package, which is a library for writing tests in Go.