Skip to content

Instantly share code, notes, and snippets.

@arran4
Last active March 29, 2019 23:15
Show Gist options
  • Save arran4/c3e42bc29d12b58119c23b319574dac2 to your computer and use it in GitHub Desktop.
Save arran4/c3e42bc29d12b58119c23b319574dac2 to your computer and use it in GitHub Desktop.
Use run.sh.. This will show that underline conditions will cause err, and the errors will be low level. (Well a lower level than the fmt package, OS level.)
package main
import (
"fmt"
"log"
"time"
)
func main() {
log.SetFlags(log.Flags()|log.Lshortfile)
for {
time.Sleep(time.Second / 10)
_, err := fmt.Println("Test line")
if err != nil{
log.Panic(err)
}
}
}
#!/usr/bin/env bash
go run main.go | head
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment