sample-golang icon indicating copy to clipboard operation
sample-golang copied to clipboard

Minor improvements: modern methods, less panic-prone

Open michurin opened this issue 1 year ago • 0 comments

Minor code update:

  • Using r.URL.Query().Get("...") instead of r.URL.Query()["..."] where this is the case
  • Using modern strings.Cut instead of strings.SplitN(..., 2)
  • Bumping required go version up to 1.18 to enable strings.Cut using
  • Fixing panic-prone code w.Header().Set(h[0], strings.TrimSpace(h[1])), where h can have arbitrary length
  • Dealing with ROUTES similarly to PORT: check len() of value

michurin avatar Jan 06 '24 03:01 michurin