From d7b14f804ca99355764b73e1032ec576afd16c2d Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Sun, 16 Mar 2025 15:56:31 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Redo=20ts=20examples=20to=20use?= =?UTF-8?q?=20gen.Make?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gen_ts_examples_test.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gen_ts_examples_test.go b/gen_ts_examples_test.go index 2f49392..26f8a91 100644 --- a/gen_ts_examples_test.go +++ b/gen_ts_examples_test.go @@ -9,8 +9,7 @@ import ( func ExampleTimestamp() { gen := nomino.Timestamp() - conf := nomino.NewConfig(nomino.WithGenerator(gen)) - s, _ := nomino.Make(conf) + s, _ := gen.Make() fmt.Println(s) } @@ -18,8 +17,7 @@ func ExampleTimestampTime() { tz, _ := time.LoadLocation("America/New_York") ts := time.Date(2009, time.January, 20, 12, 5, 0, 0, tz) gen := nomino.Timestamp(nomino.TimestampTime(ts)) - conf := nomino.NewConfig(nomino.WithGenerator(gen)) - s, _ := nomino.Make(conf) + s, _ := gen.Make() fmt.Println(s) // Output: 2009-01-20T12-05-00-0500.txt } @@ -28,8 +26,7 @@ func ExampleTimestampFormat() { tz, _ := time.LoadLocation("America/New_York") ts := time.Date(2009, time.January, 20, 12, 5, 0, 0, tz) gen := nomino.Timestamp(nomino.TimestampTime(ts), nomino.TimestampFormat("2006#01#02<>15|04|05-0700")) - conf := nomino.NewConfig(nomino.WithGenerator(gen)) - s, _ := nomino.Make(conf) + s, _ := gen.Make() fmt.Println(s) // Output: 2009#01#20<>12|05|00-0500.txt } @@ -38,8 +35,7 @@ func ExampleTimestampUTC() { tz, _ := time.LoadLocation("America/New_York") ts := time.Date(2009, time.January, 20, 12, 5, 0, 0, tz) gen := nomino.Timestamp(nomino.TimestampTime(ts), nomino.TimestampUTC()) - conf := nomino.NewConfig(nomino.WithGenerator(gen)) - s, _ := nomino.Make(conf) + s, _ := gen.Make() fmt.Println(s) // Output: 2009-01-20T17-05-00.txt }