当前位置: 动力学知识库 > 问答 > 编程问答 >

go - 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!

网友答案:

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: