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

Implementing the contact form

Now that we know what the form interface looks like, let's start implementing the contact form. In our import grouping, note that we include the validate package and the isokit package:

import (  "github.com/EngineerKamesh/igb/igweb/shared/validate"  "github.com/isomorphicgo/isokit")

Recall that we need to import the validate package for the email address validation functionality using the EmailSyntax function defined in the package.

Most of the functionality needed to implement the Form interface that we covered earlier is provided by the BasicForm type, also found in the isokit package. We will type embed the type BasicForm into the type definition of our ContactForm struct:

type ContactForm struct { isokit.BasicForm ...

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