title: Golang Undefined Functions
body: <p>I have the following package src/helpers but when i import it in a different package the only function exported is EmailValidator, but not the other ones, all of them begin with Mayus so i don't know what's happening. thanks</p>
  
  <pre><code>package models
  
  import (
      "helpers"
      ...
  )
  
  func FindByUsername(username *string) (*User, error) {
      if username == nil || len(*username) == 0 ||
              !helpers.UniqueNamesValidator(*username) {
              return nil, errors.New("Invalid Username")
      }
      ...
  }
  </code></pre>
  
  <p>src/models/user.go:88: undefined: helpers.UniqueNamesValidator</p>
  
  <p>but</p>
  
  <pre><code>func FindByEmail(email *string) (*User, error) {
      if email == nil || len(*email) == 0 || !helpers.EmailValidator(*email) {
              return nil, errors.New("Invalid Email")
      }
   ...
   }
  </code></pre>
  
  <p>works well</p>
  
  <p>here is the source code.</p>
  
  <pre><code>package helpers
  
  import (
      "regexp"
  )
  
  const (
      email_key    = "[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*"
      email_domain = "@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"
  )
  
  func EmailValidator(email string) bool {
      pattern := regexp.MustCompile(email_key + email_domain)
      return pattern.MatchString(email)
  }
  
  func UserNamesValidator(name string) bool {
      pattern := regexp.MustCompile(`\A([ña-zA-ZÑ]{3,16} {0,1}){1,3}\z`)
      return pattern.MatchString(name)
  }
  
  func UniqueNamesValidator(unique_name string) bool {
      pattern := regexp.MustCompile(`\A\w{4,10}\z`)
      return pattern.MatchString(unique_name)
  }
  
  func ProductNameValidator(p_name string) bool {
      pattern := regexp.MustCompile(`\A(\w|\s){4,30}\z`)
      return pattern.MatchString(p_name)
  }
  
  func TextOnlyValidator(text string) bool {
      pattern := regexp.MustCompile(`\A(\w+|\s)+\z`)
      return pattern.MatchString(text)
  }
  </code></pre>