Skip to content

Instantly share code, notes, and snippets.

@oieioi
Created October 12, 2017 06:31
Show Gist options
  • Save oieioi/e83048aaf1db8c25747f2808d21d1ed8 to your computer and use it in GitHub Desktop.
Save oieioi/e83048aaf1db8c25747f2808d21d1ed8 to your computer and use it in GitHub Desktop.
package main
import "net/http"
import "encoding/json"
type student struct {
Name string
Mail string
}
func main(){
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request){
data, _ := json.Marshal(student{Name: "oieioi", Mail: "[email protected]"})
w.Write(data)
})
http.ListenAndServe(":8083", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment