Skip to content

Commit

Permalink
rename NewSnowflakeEnv to GetSnowflakeEnv
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jan 23, 2022
1 parent faa192b commit 23cfd72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions snowflake.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down

0 comments on commit 23cfd72

Please sign in to comment.