Skip to content

Instantly share code, notes, and snippets.

@alanshaw
Created June 18, 2020 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanshaw/48458c638aba34f5a33cd22e55ab9f4c to your computer and use it in GitHub Desktop.
Save alanshaw/48458c638aba34f5a33cd22e55ab9f4c to your computer and use it in GitHub Desktop.
stringer detection
name := "Unknown"
sc, ok := r.Client.(fmt.Stringer)
if ok {
name = sc.String()
}
oc.log.Info("optimizing_client", "thanks for the round", "client", name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment