Skip to content

Commit

Permalink
gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Jul 16, 2021
1 parent 48138d0 commit fe02130
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cmd/OliveTin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"github.com/jamesread/OliveTin/internal/httpservers"

"github.com/fsnotify/fsnotify"
config "github.com/jamesread/OliveTin/internal/config"
"github.com/spf13/viper"
"github.com/fsnotify/fsnotify"
"os"
)

Expand Down Expand Up @@ -44,7 +44,7 @@ func init() {

cfg = config.DefaultConfig()

reloadConfig();
reloadConfig()

if logLevel, err := log.ParseLevel(cfg.LogLevel); err == nil {
log.SetLevel(logLevel)
Expand All @@ -55,7 +55,7 @@ func init() {
if e.Op == fsnotify.Write {
log.Info("Config file changed:", e.String())

reloadConfig();
reloadConfig()
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Entity struct {
// Config is the global config used through the whole app.
type Config struct {
UseSingleHTTPFrontend bool
ThemeName string
ThemeName string
ListenAddressSingleHTTPFrontend string
ListenAddressWebUI string
ListenAddressRestActions string
Expand Down
2 changes: 1 addition & 1 deletion internal/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func execAction(cfg *config.Config, actualAction *config.ActionButton) *pb.Start
"timeout": actualAction.Timeout,
}).Infof("Found action")

ctx, cancel := context.WithTimeout(context.Background(), time.Duration(actualAction.Timeout) * time.Second)
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(actualAction.Timeout)*time.Second)
defer cancel()

cmd := exec.CommandContext(ctx, "sh", "-c", actualAction.Shell)
Expand Down
8 changes: 4 additions & 4 deletions internal/httpservers/webuiServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

type webUISettings struct {
Rest string
Rest string
ThemeName string
}

Expand All @@ -34,15 +34,15 @@ func findWebuiDir() string {
return "./webui" // Should not exist
}

func generateWebUiSettings(w http.ResponseWriter, r *http.Request) {
func generateWebUISettings(w http.ResponseWriter, r *http.Request) {
restAddress := ""

if !cfg.UseSingleHTTPFrontend {
restAddress = cfg.ExternalRestAddress
}

jsonRet, _ := json.Marshal(webUISettings{
Rest: restAddress + "/api/",
Rest: restAddress + "/api/",
ThemeName: cfg.ThemeName,
})

Expand All @@ -56,7 +56,7 @@ func startWebUIServer(cfg *config.Config) {

mux := http.NewServeMux()
mux.Handle("/", http.FileServer(http.Dir(findWebuiDir())))
mux.HandleFunc("/webUiSettings.json", generateWebUiSettings)
mux.HandleFunc("/webUiSettings.json", generateWebUISettings)

srv := &http.Server{
Addr: cfg.ListenAddressWebUI,
Expand Down

0 comments on commit fe02130

Please sign in to comment.