func parseTime(format, value string) (*time.Time, os.Error) {time, err := time.Parse(format, strings.TrimSpace(value))if err != nil {return nil, err}return time, nil}
func parseTime(format, value string) (time.Time, error) {time, err := time.Parse(format, strings.TrimSpace(value))if err != nil {return nil, err}return time, nil}
time.Time{}
.\parse.go:13: time.Time undefined (type time.Time has no field or method Time)
Why not bypass the issue, avoid any testing, and just return `time, err`?
Chris
--
Chris "allusive" Dollin
On Feb 12, 2012 12:20 AM, "Mikhail Strebkov" <stre...@gmail.com> wrote:
> It was my first move, but "go build" prints this:
>>
>> .\parse.go:13: time.Time undefined (type time.Time has no field or method Time)
That can't be right. What's the whole code that yields that error?
Dave.
func parseTime(format, value string) (time.Time, error) {
return time.Parse(format, strings.TrimSpace(value))
}
Inlining.