Why does go sometimes allow you to call functions without catching both return values? Such as:
func TestGolang() {
myMap := make(map[string]string)
test := myMap["value"]
// or
test, success := myMap["value"]
}
While at other times, you are required to catch all the return results and use a blank identifier if you do not want to use the value?
test := os.Stat("test") // fails
test, _ := os.Stat("test") // only way to make it work
I thought golang does not support different method signatures for a single function. How does the first example work? Can I implement my own functions that optionally return an error or a status flag but does not error out if the 2nd return value is not caught?