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

Advertisements 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.… 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

Advertisements 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… Read More Why dereference only to reference again in Go