(format string)
| 123 | } |
| 124 | |
| 125 | func formatToLayout(format string) string { |
| 126 | switch format { |
| 127 | case ansic: |
| 128 | return time.ANSIC |
| 129 | case unixdate: |
| 130 | return time.UnixDate |
| 131 | case rubydate: |
| 132 | return time.RubyDate |
| 133 | case rfc822: |
| 134 | return time.RFC822 |
| 135 | case rfc822z: |
| 136 | return time.RFC822Z |
| 137 | case rfc850: |
| 138 | return time.RFC850 |
| 139 | case rfc1123: |
| 140 | return time.RFC1123 |
| 141 | case rfc1123z: |
| 142 | return time.RFC1123Z |
| 143 | case rfc3339: |
| 144 | return time.RFC3339 |
| 145 | case rfc3339nano: |
| 146 | return time.RFC3339Nano |
| 147 | default: |
| 148 | return format |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | func genParseFun(format string) func(b []byte) (time.Time, error) { |
| 153 | switch format { |
no outgoing calls
no test coverage detected