/gabtec-gou

Some Go utility functions

Primary LanguageGoMIT LicenseMIT

Gabtec-Gou

This is my first published Go package.

It's called gabtec-gou, because "gou" stands for "Go Utils" 😄

Usage

# create a new project
# after you have your go.mod file setup
# run:
$ go get -u github.com/gabtec/gabtec-gou

Then use it, like this:

// e.g. in your main.go file

package main

import "github.com/gabtec/gabtec-gou"

func main() {
  myVar := gou.GetEnv("TheEnvVarName_aka_key", "Some_default_value_in_case_envVar_not_set_or_not_found")
  //...
}

Available Functions

💼 GetEnv(key, defaultValue string) string {}

💼 StrSlice(s string, n int) string {}

💼 SliceContainsString(slice []string, str string) bool {}

Testing

# to run tests, do:
$ go test -v ./...

License

MIT