From 23cfd72ba0bb0e14a4c1663765ba70ea4ae9351e Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Sun, 23 Jan 2022 17:40:08 +0100 Subject: [PATCH] rename NewSnowflakeEnv to GetSnowflakeEnv --- README.md | 2 +- snowflake.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 64bf4b6..90c9b83 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ id.Int64() id = NewSnowflake(time.Now()) // returns a snowflake from an environment variable -id = NewSnowflakeEnv("guild_id") +id = GetSnowflakeEnv("guild_id") ``` ## License diff --git a/snowflake.go b/snowflake.go index 6ee8116..653154e 100644 --- a/snowflake.go +++ b/snowflake.go @@ -14,9 +14,9 @@ func NewSnowflake(timestamp time.Time) Snowflake { return Snowflake(strconv.FormatInt(((timestamp.UnixNano()/1_000_000)-Epoch)<<22, 10)) } -// NewSnowflakeEnv returns a new Snowflake from an environment variable +// GetSnowflakeEnv returns a new Snowflake from an environment variable //goland:noinspection GoUnusedExportedFunction -func NewSnowflakeEnv(key string) Snowflake { +func GetSnowflakeEnv(key string) Snowflake { return Snowflake(os.Getenv(key)) }