Skip to content

Commit f0bb44e

Browse files
committed
docs improvements
1 parent 9b623c2 commit f0bb44e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ go get github.com/bjubes/config
2626
```
2727

2828
2. Make your custom struct implements the `Configurator` interface using the following code (just copy and paste)
29-
```go
29+
```go
3030
func (c MyConfig) GetEnvString(field string) string {
3131
return config.GetEnvString(c, field)
3232
}
@@ -39,10 +39,10 @@ go get github.com/bjubes/config
3939
func (c MyConfig) GetEnvFloat(field string) float64 {
4040
return config.GetEnvFloat(c, field)
4141
}
42-
```
42+
```
4343

4444
3. Retrieve a value using the methods on your config instance
45-
```go
45+
```go
4646
host := myConfig.GetEnvString("DB_HOST")
4747
port := myConfig.GetEnvInt("DB_PORT")
4848
prod := myConfig.GetEnvBool("PROD")

configurator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type Configurator interface {
1919
}
2020

2121
// GetEnvString gets a string from the environment, falling back to the same field name in the config struct.
22-
// If it doesn't exist in either, the function will log an error then exit 1
22+
// If it doesn't exist in either, the function will log an error and panic
2323
func GetEnvString(config Configurator, field string) string {
2424
defer func() {
2525
if r := recover(); r != nil {
@@ -34,7 +34,7 @@ func GetEnvString(config Configurator, field string) string {
3434
}
3535

3636
// GetEnvBool gets a bool from the environment, falling back to the same field name in the config struct.
37-
// If it doesn't exist in either, the function will log an error then exit 1
37+
// If it doesn't exist in either, the function will log an error and panic
3838
func GetEnvBool(config Configurator, field string) bool {
3939
defer func() {
4040
if r := recover(); r != nil {
@@ -52,7 +52,7 @@ func GetEnvBool(config Configurator, field string) bool {
5252
}
5353

5454
// GetEnvInt gets an int from the environment, falling back to the same field name in the config struct.
55-
// If it doesn't exist in either, the function will log an error then exit 1
55+
// If it doesn't exist in either, the function will log an error and panic
5656
func GetEnvInt(config Configurator, field string) int {
5757
defer func() {
5858
if r := recover(); r != nil {
@@ -70,7 +70,7 @@ func GetEnvInt(config Configurator, field string) int {
7070
}
7171

7272
// GetEnvFloat gets a float from the environment, falling back to the same field name in the config struct.
73-
// If it doesn't exist in either, the function will log an error then exit 1
73+
// If it doesn't exist in either, the function will log an error and panic
7474
func GetEnvFloat(config Configurator, field string) float64 {
7575
defer func() {
7676
if r := recover(); r != nil {

0 commit comments

Comments
 (0)