1、解壓壓縮包到go工作目錄,如解壓到E:\opensource\go\go,解壓后的目錄結(jié)構(gòu)如下:E:\opensource\go\go├─api├─bin│├─go.exe│├─godoc.exe│└─gofmt.exe├─doc├─include├─lib├─misc├─pkg├─src└─test2、增加環(huán)境變量GOROOT,取值為上面的go工作目錄3、Path環(huán)境變量中添加";%GOROOT%\bin",以便能夠直接調(diào)用go命令來(lái)編譯go代碼,至此go編譯環(huán)境就配置好了注:如果不想手動(dòng)設(shè)置系統(tǒng)環(huán)境變量,也可下載go啟動(dòng)環(huán)境批處理附件,修改goenv.bat文件中的GOROOT值為上面的go工作目錄后直接雙擊該bat文件,go編譯環(huán)境變量即設(shè)置完成。4、測(cè)試go編譯環(huán)境,啟動(dòng)一個(gè)cmd窗口,直接輸入go,看到下面的提示就是搭建成功了E:\opensource\go\gogoGoisatoolformanagingGosourcecode.Usage:gocommand[arguments]Thecommandsare:buildcompilepackagesanddependenciescleanremoveobjectfilesdocrungodoconpackagesourcesenvprintGoenvironmentinformationfixrungotoolfixonpackagesfmtrungofmtonpackagesourcesgetdownloadandinstallpackagesanddependenciesinstallcompileandinstallpackagesanddependencieslistlistpackagesruncompileandrunGoprogramtesttestpackagestoolrunspecifiedgotoolversionprintGoversionvetrungotoolvetonpackagesUse"gohelp[command]"formoreinformationaboutacommand.Additionalhelptopics:gopathGOPATHenvironmentvariablepackagesdescriptionofpackagelistsremoteremoteimportpathsyntaxtestflagdescriptionoftestingflagstestfuncdescriptionoftestingfunctionsUse"gohelp[topic]"formoreinformationaboutthattopic.5、編譯helloworld測(cè)試程序,go語(yǔ)言包中test目錄帶有helloworld.go測(cè)試程序,源碼見(jiàn)"附一helloworld.go",直接調(diào)用"gobuildhelloworld.go"就生成了"helloworld.exe"可執(zhí)行程序,運(yùn)行一下這個(gè)程序看到了我們期望的hello,wolrd。E:\opensource\go\go\testgobuildhelloworld.goE:\opensource\go\go\testhelloworld.exehello,worldE:\opensource\go\go\test附一helloworld.go//cmpout//Copyright2009TheGoAuthors.Allrightsreserved.//UseofthissourcecodeisgovernedbyaBSD-style//licensethatcanbefoundintheLICENSEfile.//Testthatwecandopage1oftheCbook.packagemainfuncmain(){print("hello,world\n")}
成都創(chuàng)新互聯(lián)公司是一家專注于成都網(wǎng)站制作、成都網(wǎng)站建設(shè)與策劃設(shè)計(jì),廣南網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)公司做網(wǎng)站,專注于網(wǎng)站建設(shè)10多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:廣南等地區(qū)。廣南做網(wǎng)站價(jià)格咨詢:18980820575
task copyFileToProject1(type: Copy) {
from('build/intermediates/bundles/debug/')
into("$rootProject.projectDir/demousingsdk/libs/")
include('classes.jar')
rename('classes.jar', 'xiaoi_sdk.jar')
}
高級(jí)!能用上go語(yǔ)言了嗎?不會(huì)是Android Studio吧?!
如果是Apk是連不上SQL的,訪問(wèn)WebService,手機(jī)做SQL服務(wù)一般用WEB,不用WAP,手機(jī)可以直接訪問(wèn)WEB,無(wú)論什么編寫(xiě)的,如果是特殊需要,那就用WebService去返回查詢結(jié)果