26 lines
652 B
Go
26 lines
652 B
Go
|
package globals
|
||
|
|
||
|
// Global variables, Mocks, etc.
|
||
|
// This package shall not have any dependency towards the application itself!
|
||
|
import (
|
||
|
"log"
|
||
|
"os/user"
|
||
|
"path"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
user, err := user.Current()
|
||
|
if err != nil {
|
||
|
log.Printf("Current user not obtainable: %s", err)
|
||
|
log.Fatal("Impossible to open default database")
|
||
|
}
|
||
|
|
||
|
// ConfigDirectoryList Configuration directory list Linux
|
||
|
ConfigDirectoryList = []string{user.HomeDir, ".config", "ppforge"}
|
||
|
|
||
|
// ConfigDirectory Configuration directory string Linux
|
||
|
ConfigDirectory = path.Join(ConfigDirectoryList...)
|
||
|
|
||
|
CollectionOfProtocolsDir = path.Join(append(ConfigDirectoryList, "cop")...)
|
||
|
}
|