Client-side considerations

Amazingly enough, there isn't much work that we need to perform to get the contact form going on the client side. Let's examine the contact.go source file found in the client/handlers folder, section by section:

func ContactHandler(env *common.Env) isokit.Handler {  return isokit.HandlerFunc(func(ctx context.Context) {    contactForm := forms.NewContactForm(nil)    DisplayContactForm(env, contactForm)  })}

This is our ContactHandler function, which will service the needs of the /contact route on the client side. We start off by declaring and initializing the contactForm variable, assigning it to the ContactForm instance that is returned by calling the NewContactForm constructor function.

Note that we pass nil to the constructor ...

Get Isomorphic Go now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.