In the case of a function returning a single value, a constant result could be ignored, and the function would return a zero value. Fixes #889.
18 lines
176 B
Go
18 lines
176 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
func get10Hours() time.Duration {
|
|
return 10 * time.Hour
|
|
}
|
|
|
|
func main() {
|
|
fmt.Println(get10Hours().String())
|
|
}
|
|
|
|
// Output:
|
|
// 10h0m0s
|