O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required