Как мы читаем с ресурса URL.Я использовал https://github.com/Kissaki/rest.go API в следующем примере.Ниже приведен пример, который я использую для записи строки в URL http://localhost:8080/cool Но теперь мне нужно получить данные из URL, как мне их прочитать?
package main
import (
"fmt"
"http"
"github.com/nathankerr/rest.go"
)
type FileString struct {
value string
}
func (t *FileString) Index(w http.ResponseWriter) {
fmt.Fprintf(w, "%v", t.value)
}
func main(){
rest.Resource("cool", &FileString{s:"this is file"})
http.ListenAndServe(":3000", nil)
}