File: issue94.go

package info (click to toggle)
golang-github-tinylib-msgp 1.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 476 kB
  • sloc: makefile: 42; sh: 10
file content (31 lines) | stat: -rw-r--r-- 629 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package _generated

import (
	"time"
)

//go:generate msgp

// Issue 94: shims were not propogated recursively,
// which caused shims that weren't at the top level
// to be silently ignored.
//
// The following line will generate an error after
// the code is generated if the generated code doesn't
// have the right identifier in it.

//go:generate ./search.sh $GOFILE timetostr

//msgp:shim time.Time as:string using:timetostr/strtotime
type T struct {
	T time.Time
}

func timetostr(t time.Time) string {
	return t.Format(time.RFC3339)
}

func strtotime(s string) time.Time {
	t, _ := time.Parse(time.RFC3339, s)
	return t
}