Sfoglia il codice sorgente

patch code to work with latest config lib updates

Casey DeLorme 9 anni fa
parent
commit
af6b49ad45
1 ha cambiato i file con 7 aggiunte e 7 eliminazioni
  1. 7 7
      main.go

+ 7 - 7
main.go

@@ -79,29 +79,29 @@ func main() {
 	flags := appOptions.Parse()
 
 	// apply flags
-	t, _ := maps.String(&flags, "", "template")
+	t, _ := maps.String(flags, "", "template")
 	if tmpl, err := template.ParseFiles(t); err != nil {
 		staticmd.Logger.Error("Failed to open template: %s", err)
 		os.Exit(1)
 	} else {
 		staticmd.Template = *tmpl
 	}
-	staticmd.Input, _ = maps.String(&flags, staticmd.Input, "input")
-	staticmd.Output, _ = maps.String(&flags, staticmd.Output, "output")
-	staticmd.Book, _ = maps.Bool(&flags, staticmd.Book, "book")
-	staticmd.Relative, _ = maps.Bool(&flags, staticmd.Relative, "relative")
+	staticmd.Input, _ = maps.String(flags, staticmd.Input, "input")
+	staticmd.Output, _ = maps.String(flags, staticmd.Output, "output")
+	staticmd.Book, _ = maps.Bool(flags, staticmd.Book, "book")
+	staticmd.Relative, _ = maps.Bool(flags, staticmd.Relative, "relative")
 
 	// sanitize input & output
 	staticmd.Input, _ = filepath.Abs(staticmd.Input)
 	staticmd.Output, _ = filepath.Abs(staticmd.Output)
 
 	// optionally enable debugging
-	if debug, _ := maps.Bool(&flags, false, "debug"); debug {
+	if debug, _ := maps.Bool(flags, false, "debug"); debug {
 		staticmd.Logger.Severity = log.Debug
 	}
 
 	// optionally enable profiling
-	if profile, _ := maps.String(&flags, "", "profile"); profile != "" {
+	if profile, _ := maps.String(flags, "", "profile"); profile != "" {
 		f, _ := os.Create(profile)
 		pprof.StartCPUProfile(f)
 		defer pprof.StopCPUProfile()