realize/config/utils.go

23 lines
277 B
Go
Raw Normal View History

2016-10-21 13:59:11 +00:00
package config
import (
"log"
"os"
"path/filepath"
)
type Utils struct{}
2016-10-21 14:14:39 +00:00
func (u *Utils) Wdir() string {
2016-10-21 13:59:11 +00:00
dir, err := os.Getwd()
2016-10-21 14:14:39 +00:00
u.Validate(err)
2016-10-21 13:59:11 +00:00
return filepath.Base(dir)
}
2016-10-21 14:14:39 +00:00
func (u *Utils) Validate(err error) error {
2016-10-21 13:59:11 +00:00
if err != nil {
log.Fatal(err)
}
return nil
}