trouble installing "gorilla/mux" in golang

So I installed gorilla/mux to use it for my API by typing this code on terminal go get -u github.com/gorilla/mux And since it didn’t return any errors (nor any texts) I thought the install was successful. But When I started to use "mux. "something, vscode showed that the name "mux" is not declared. Does anyone… Read More trouble installing "gorilla/mux" in golang

How to find a single element in a set that isn't in another using set comprehension

I have two sets, set1 and set2… Almost all elements in both sets are the same except for one element. Supporting code is below: set1 = {‘dog’, ‘cat’, ‘turtle’, ‘monkey’} set2 = {‘dog’, ‘cat’, ‘turtle’, ‘gorilla’} I am trying to get the unique element of each set into its own variable using set comprehension. set1Unique… Read More How to find a single element in a set that isn't in another using set comprehension

Why dereference only to reference again in Go

In gorilla/sessions there is the following code: func (s *CookieStore) New(r *http.Request, name string) (*Session, error) { session := NewSession(s, name) opts := *s.Options session.Options = &opts … Where s.Options is of type *sessions.Options: type CookieStore struct { … Options *Options // default configuration } And sessios.Session.Options is also of type *sessions.Options: type Session struct… Read More Why dereference only to reference again in Go