30 lines
433 B
Go
30 lines
433 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
// Contains tells whether a contains x.
|
|
func Contains(a []string, x string) bool {
|
|
log.Println("Search for: " + x)
|
|
for _, n := range a {
|
|
log.Println("Piece of Array: " + n)
|
|
if x == n {
|
|
return true
|
|
}
|
|
if "@"+x == n {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
func getenv(key, fallback string) string {
|
|
value := os.Getenv(key)
|
|
if len(value) == 0 {
|
|
return fallback
|
|
}
|
|
return value
|
|
}
|