doulin2947
doulin2947
2017-01-25 08:52
浏览 320
已采纳

Gomobile软件包中没有导出的名称

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!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dougao1542
    dougao1542 2017-01-25 08:57
    已采纳

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

    点赞 评论

相关推荐