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)) }