You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
629 B

  1. package _generated
  2. import (
  3. "time"
  4. )
  5. //go:generate msgp
  6. // Issue 94: shims were not propogated recursively,
  7. // which caused shims that weren't at the top level
  8. // to be silently ignored.
  9. //
  10. // The following line will generate an error after
  11. // the code is generated if the generated code doesn't
  12. // have the right identifier in it.
  13. //go:generate ./search.sh $GOFILE timetostr
  14. //msgp:shim time.Time as:string using:timetostr/strtotime
  15. type T struct {
  16. T time.Time
  17. }
  18. func timetostr(t time.Time) string {
  19. return t.Format(time.RFC3339)
  20. }
  21. func strtotime(s string) time.Time {
  22. t, _ := time.Parse(time.RFC3339, s)
  23. return t
  24. }