25 lines
644 B
Go
25 lines
644 B
Go
package globals
|
|
|
|
// Global variables, Mocks, etc.
|
|
// This package shall not have any dependency towards the application itself!
|
|
import (
|
|
"log"
|
|
"path"
|
|
)
|
|
|
|
func init() {
|
|
user, err := MockUserCurrent()
|
|
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")...)
|
|
}
|