mirror of
https://github.com/wahyd4/say-it.git
synced 2026-08-09 05:06:41 +10:00
25 lines
349 B
Go
25 lines
349 B
Go
package utils
|
|
|
|
import (
|
|
"os/user"
|
|
|
|
log "github.com/Sirupsen/logrus"
|
|
)
|
|
|
|
func HomeDir() string {
|
|
usr, err := user.Current()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
return usr.HomeDir
|
|
}
|
|
|
|
func CheckContentType(contentTypes []string, target string) bool {
|
|
for _, item := range contentTypes {
|
|
if item == target {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|