Remove fmt
This commit is contained in:
parent
6abd70061d
commit
e197051c6e
4
main.go
4
main.go
|
@ -1,7 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"github.com/dchest/uniuri"
|
"github.com/dchest/uniuri"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
@ -57,11 +56,10 @@ func save(buf []byte) string {
|
||||||
func pasteHandler(w http.ResponseWriter, r *http.Request) {
|
func pasteHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
switch r.Method {
|
switch r.Method {
|
||||||
case "GET":
|
case "GET":
|
||||||
fmt.Fprintf(w, text)
|
io.WriteString(w, text)
|
||||||
case "POST":
|
case "POST":
|
||||||
buf, _ := ioutil.ReadAll(r.Body)
|
buf, _ := ioutil.ReadAll(r.Body)
|
||||||
io.WriteString(w, address+save(buf)+"\n")
|
io.WriteString(w, address+save(buf)+"\n")
|
||||||
|
|
||||||
case "DELETE":
|
case "DELETE":
|
||||||
// Remove the record.
|
// Remove the record.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue