Philipp15b / go-steamapi

Steam Web API in Go.
http://godoc.org/github.com/Philipp15b/go-steamapi
MIT License
93 stars 28 forks source link

[Profiles] Adding Human readable PersonaStates #4

Closed Khabi closed 5 years ago

Khabi commented 9 years ago

This gives you a nice human readable representation of the PersonaState.

   fmt.Fprintf(w, "%s is %s\n", user_info.PersonaName, user_info.PersonaState)

would print out

  "<user> is Online"

instead of the current approach that would print

  "<user> is 1"

This also lets you do things like:

  if user_info.PersonState.String() == "Online" {}
Philipp15b commented 8 years ago

Why not simply do something like

switch p {
     case Offline:
           return "Offline"
    ...
}

?