Golang Parse time, strange behavior, but why?

Kind time, Respected community. Can who faced a similar problem more like a BUG. Tried to unmarshall a date string and not out, this is what came:
func (c *CustomDate) UnmarshalJSON(b []byte) (err error) {
 s := strings.Trim(string(b), `"`) 
 if s == "null" {
return
}
 t, err := time.Parse(time.RFC3339, time.RFC3339)
 if err != nil {
 return err
}
 c.Time = t
return
}

Why this design gets the parsing error? If very essence:
func main() {
 _, err := time.Parse(time.RFC3339, time.RFC3339)
 if err != nil {
panic(err)
}
}

How??? go 1.9
Thank you in advance all who were interested.
April 19th 20 at 12:01
3 answers
April 19th 20 at 12:03
Solution
Really strange design. And it looks like a bug. A function of time.Parse takes the format and time value. And there are two identical argument.
Actually, here in the example at the bottom there is a string which describes the error
))))) thanks for the reply, and actually started with the fact that I can't get a date from this 2020-04-02T12:44:00.79, can You tell me what should be the layout for this format? - Domenica_Grady commented on April 19th 20 at 12:06
April 19th 20 at 12:05
Because the time constant const.RFC3339 = "2006-01-02T15:04:05Z07:00" is not a valid time. Z in RFC3339 is the alphabetical index for the time zone (Zulu in this case). The area may also be marked with offset +07:00 Or so, or commercials:
"2006-01-02T15:04:05Z"
or
"2006-01-02T15:04:05+07:00"
And the constant from the package - fit pattern for parsing, but not a valid time
April 19th 20 at 12:07
Thanks to kind people, the question is removed, understood, normal BLUNT. I do not understand why it worked, but not direct hands definitely helped. Here's how it works:
const layout = "2006-01-02T15:04:05.99"

func (c *CustomDate) UnmarshalJSON(b []byte) (err error) {
 s := strings.Trim(string(b), `"`)
 if s == "null" {
return
}
 t, err := time.Parse(layout, s)
 if err != nil {
 return err
}
 c.Time = t
return
}

Find more questions by tags Work with date / timeGo