Last active
March 29, 2019 23:15
-
-
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.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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