From 3f56aac8c1170fefb73161b1587eb38f54c9f567 Mon Sep 17 00:00:00 2001 From: mappu Date: Tue, 6 Nov 2018 19:21:20 +1300 Subject: [PATCH] convert to go modules --- go.mod | 3 ++ go.sum | 2 + .../github.com/jehiah/go-strftime/.gitignore | 22 +++++++++ .../github.com/jehiah/go-strftime/README.md | 24 ++++++++- .../jehiah/go-strftime/strftime_test.go | 49 ------------------- vendor/modules.txt | 2 + 6 files changed, 52 insertions(+), 50 deletions(-) create mode 100644 go.mod create mode 100644 go.sum create mode 100644 vendor/github.com/jehiah/go-strftime/.gitignore delete mode 100644 vendor/github.com/jehiah/go-strftime/strftime_test.go create mode 100644 vendor/modules.txt diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..7d8c9d1 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module code.ivysaur.me/archive + +require github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..22788d4 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= +github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= diff --git a/vendor/github.com/jehiah/go-strftime/.gitignore b/vendor/github.com/jehiah/go-strftime/.gitignore new file mode 100644 index 0000000..0026861 --- /dev/null +++ b/vendor/github.com/jehiah/go-strftime/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe diff --git a/vendor/github.com/jehiah/go-strftime/README.md b/vendor/github.com/jehiah/go-strftime/README.md index 8eb2403..10b06f4 100644 --- a/vendor/github.com/jehiah/go-strftime/README.md +++ b/vendor/github.com/jehiah/go-strftime/README.md @@ -1,4 +1,26 @@ go-strftime =========== -go implementation of strftime \ No newline at end of file +go implementation of strftime + +## Example + +``` +package main + +import ( + "fmt" + "time" + + strftime "github.com/jehiah/go-strftime" +) + +func main() { + t := time.Unix(1340244776, 0) + utc, _ := time.LoadLocation("UTC") + t = t.In(utc) + fmt.Println(strftime.Format("%Y-%m-%d %H:%M:%S", t)) + // Output: + // 2012-06-21 02:12:56 +} +``` diff --git a/vendor/github.com/jehiah/go-strftime/strftime_test.go b/vendor/github.com/jehiah/go-strftime/strftime_test.go deleted file mode 100644 index a6bd2aa..0000000 --- a/vendor/github.com/jehiah/go-strftime/strftime_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package strftime - -import ( - "fmt" - "testing" - "time" -) - -func ExampleFormat() { - t := time.Unix(1340244776, 0) - utc, _ := time.LoadLocation("UTC") - t = t.In(utc) - fmt.Println(Format("%Y-%m-%d %H:%M:%S", t)) - // Output: - // 2012-06-21 02:12:56 -} - -func TestNoLeadingPercentSign(t *testing.T) { - tm := time.Unix(1340244776, 0) - utc, _ := time.LoadLocation("UTC") - tm = tm.In(utc) - result := Format("aaabbb0123456789%Y", tm) - if result != "aaabbb01234567892012" { - t.Logf("%s != %s", result, "aaabbb01234567892012") - t.Fail() - } -} - -func TestUnsupported(t *testing.T) { - tm := time.Unix(1340244776, 0) - utc, _ := time.LoadLocation("UTC") - tm = tm.In(utc) - result := Format("%0%1%%%2", tm) - if result != "%0%1%%2" { - t.Logf("%s != %s", result, "%0%1%%2") - t.Fail() - } -} - -func TestRubyStrftime(t *testing.T) { - tm := time.Unix(1340244776, 0) - utc, _ := time.LoadLocation("UTC") - tm = tm.In(utc) - result := Format("%H:%M:%S%L", tm) - if result != "02:12:56.000" { - t.Logf("%s != %s", result, "02:12:56.000") - t.Fail() - } -} diff --git a/vendor/modules.txt b/vendor/modules.txt new file mode 100644 index 0000000..e9e973b --- /dev/null +++ b/vendor/modules.txt @@ -0,0 +1,2 @@ +# github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 +github.com/jehiah/go-strftime