package main import ( "fmt" "log" "net/http" "reflect" ) func handler(w http.ResponseWriter, r *http.Request) { playingInfo := getInfo() v := reflect.ValueOf(playingInfo) k := v.Type() for i := range v.NumField() { log.Printf("%s: %s\n", k.Field(i).Name, v.Field(i)) } fmt.Fprintf( w, "

%s

%s

%s

", playingInfo.artistName, playingInfo.recordingName, playingInfo.releaseName, playingInfo.recordingUrl, playingInfo.coverUrl, ) }