Skip to content
Permalink
Browse files

Added $GOPATH as the default configuration location.

  • Loading branch information...
artob committed Mar 25, 2019
1 parent 01b1ff9 commit 3d4a7f034bc668f84757d38c82290c24ea345792
Showing with 5 additions and 0 deletions.
  1. +5 −0 drycop/cmd/root.go
@@ -4,6 +4,7 @@ package cmd

import (
"fmt"
"go/build"
"os"

log "github.com/Sirupsen/logrus"
@@ -52,6 +53,7 @@ func initConfig() {
viper.SetConfigName("config")
viper.AddConfigPath(".")
viper.AddConfigPath("$HOME/.drycop")
viper.AddConfigPath(fmt.Sprintf("%s/src/%s", build.Default.GOPATH, "github.com/dryproject/drycop"))
}

viper.AutomaticEnv() // read in environment variables that match
@@ -65,6 +67,9 @@ func initConfig() {

// Configure the logger output format:
log.SetOutput(os.Stderr)
if outputFormat == "" {
outputFormat = viper.GetString("output")
}
switch outputFormat {
case "json":
log.SetFormatter(&log.JSONFormatter{})

0 comments on commit 3d4a7f0

Please sign in to comment.
You can’t perform that action at this time.