fix: incorrect use of printf-line functions

pull/2/head
Petr Razumov 2023-04-04 15:13:27 +03:00
parent 082d5f1d3f
commit 7a0bdf67fd
2 changed files with 6 additions and 6 deletions

View File

@ -241,19 +241,19 @@ Options:
}
hash[id] += 1
if hash[id] > 0 {
fmt.Printf("Error. DB has changed. Aborted.\n")
fmt.Println("Error. DB has changed. Aborted.")
os.Exit(1)
}
return true
})
f.Close()
if err != nil {
fmt.Printf("Error: %s\n")
fmt.Println("Error:", err)
os.Exit(1)
}
for _, v := range hash {
if v != 0 {
fmt.Printf("Error. DB shrinked. Aborted.\n")
fmt.Println("Error. DB shrinked. Aborted.")
os.Exit(1)
}
}
@ -261,7 +261,7 @@ Options:
case "fetch":
var echolist []string
if len(args) < 2 {
fmt.Printf("No url supplied\n")
fmt.Println("No url supplied")
os.Exit(1)
}
db := open_db(*db_opt)

View File

@ -206,7 +206,7 @@ func main() {
return
}
ii.Info.Printf("/u/point/%s/%s GET request", pauth, tmsg)
fmt.Fprintf(w, PointMsg(edb, db, udb, pauth, tmsg))
fmt.Fprintln(w, PointMsg(edb, db, udb, pauth, tmsg))
})
http.HandleFunc("/u/point", func(w http.ResponseWriter, r *http.Request) {
var pauth, tmsg string
@ -222,7 +222,7 @@ func main() {
return
}
ii.Info.Printf("/u/point/%s/%s POST request", pauth, tmsg)
fmt.Fprintf(w, PointMsg(edb, db, udb, pauth, tmsg))
fmt.Fprintln(w, PointMsg(edb, db, udb, pauth, tmsg))
})
http.HandleFunc("/x/c/", func(w http.ResponseWriter, r *http.Request) {
enames := strings.Split(r.URL.Path[5:], "/")