Search code examples
gogomobile

Gomobile no exported names in the package


I am trying to bind the following code with gomobile to export it as a framework for iOS. I have done this before successfully but for some reason the following code, when I run the bind command gives me the error gomobile: no exported names in the package . The code works when ran as a go script.

   package request

import (
    "net/url"
    "fmt"
)

func requestEndpoint(number string) string {

    safeNumber := url.QueryEscape(number)
  url := fmt.Sprintf("http://apilayer.net/api/validate?access_key=690a581e85900555754fd7bfa70808b2&number=%s&country_code=&format=1", safeNumber)


   return url

  }

Any ideas? Thanks!


Solution

  • Function requestEndpoint should be changed to RequestEndpoint. The capitalized function is considered as exported within the package.