草庐IT

import-all-table

全部标签

go - 问 import undefined Go

我有关于在golang上导入的问题。如何在golang上调用包路由和函数getRoute(我自己的函数)?我的主包是packagemainimport("github.com/majalah/apps/routes")funcmain(){routes.getRoute()}我的路由包在应用程序和文件夹路由中packageroutesfuncgetRoute(){}总是出错4.2importedandnotused"routes"8.2undefined"routes" 最佳答案 以小写字母开头的函数是一个未导出的函数。unexpo

go - 忽略 "imported and not used"编译时错误

我收到这个错误:src/huru/utils/utils.go:6:2:importedandnotused:"fmt"src/huru/utils/utils.go:9:2:importedandnotused:"net/http"当我有这些未使用的导入时:import("fmt""net/http")itturnsoutthisaratherseriouslyannoying"feature"becausesomeIDEslikeVSCodewillautomaticallyremoveunusedimportswhichisf*ckingannoyingwhenyouareabo

android编程使用Go mobile报错import go.hello.Hello

我对在androidstudio中导入import.hello.Hello时出错有疑问,如下图所示。请给我解决方案如何解决这个错误 最佳答案 请参阅此处@ArpitPatelanswer你需要这样设置路径正如你所说的,你有64位系统,然后复制此路径C:\ProgramFiles\Java\jdk1.8.0_31第1步:-通过单击新建和过去(C:\ProgramFiles\Java\jdk1.8.0_31)此路径创建JAVA_HOME变量。第2步然后单击路径变量并编辑,然后在添加分号(;)C:\ProgramFiles\Java\jd

go - Go程序"Import cycle not allowed"错误

我是Go的新手,我正在尝试制作一个程序来显示当前时间和其他一些内容://Aterribleprogram.packagemainimport("fmt""time")//greetingreturnsagreetingwithsomeinfo.funcgreeting()string{return"Helloflatworld,thetimeis:"+time.Now().String()}funcmain(){hotelName:="Trivag"hotelName+="o"fmt.Println(greeting())fmt.Println("Hotel:"+hotelName)}

postgresql - 如何修复 "missing FROM-clause entry for table"错误

我正在尝试根据游戏ID获取平台名称。我有如下三个表,我正在尝试连接它们以获得所需的结果:GamesId|.....|.....|---|------------|1|.|.|2|.|.|3|.|.|4|.|.|Game_PlatformsId|....|game_id|platform_id|...|---------------------------------1|.|1|1|..|2|.|1|2|..|3|.|3|3|..|..|.|4|4|..|PlatformsId|...|...|name|---------------------|1|.|.|iOS|2|.|.|Andr

import - 有没有办法稍后在golang中导入?

我正在编写一个小的go程序。我希望它能在不同的操作系统上运行,所以我希望使用gorun而不是包含编译后的文件。问题是它使用了标准库之外的包。我不想依赖拥有包裹的人。我可以使用packagemainimport"os/exec"funcmain(){_:=exec.Command("go","get","github.com/user/library").Run()}但到那时再导入它已经太晚了。我可以看到三个解决方案。制作包装脚本。交叉编译让用户去做但是我很想安装然后导入,有什么办法吗? 最佳答案 只需将您的代码托管在github或其

golang编译错误: can't find import

我正在尝试在目录$GOPATH/src/call/httptest中运行gobuild命令:maks@myMac~/Dropbox/golang/src/call/httptest$gobuild#call/httptest./domain.go:4:can'tfindimport:"call"有错误./domain.go:4:找不到导入:“call”domain.go文件开头:packagehttptestimport("call"//line4-errorishere)我可以在$GOPATH/src/call目录中成功构建:maks@myMac~/Dropbox/golang/sr

转到模块 : "cannot find module providing package" importing sub package of a dependency

关闭。这个问题是notreproducibleorwascausedbytypos.它目前不接受答案。这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助future的读者。关闭3年前。Improvethisquestion我在$GOPATH之外有一个项目,我想使用gomod。但是,当我从$GOPATH中的项目复制代码并运行时$GO111MODULE=ongomodinitgithub.com/jgoc/modtest$GO111MODULE=ongorunmain.go我得到一个错误。go版本go1.12.5wind

arrays - Append for array of maps raplaces all previous array items on the 最新的一个

这个问题听起来可能很愚蠢,但我真的不明白哪里出了问题。我想像这样创建一个map数组:values:=make([]map[string]string,0)然后我创建一些map:row:=make(map[string]string)row["item1"]="value1"row["item2"]="value2"然后将其追加到数组中:values=append(values,row)打印值现在给出:[map[item1:value1item2:value2]]使用其他一些值做同样的事情:row["item1"]="value3"row["item2"]="value4"values=

regex - 戈朗 : Remove all characters except | from string

关闭。这个问题需要debuggingdetails.它目前不接受答案。编辑问题以包含desiredbehavior,aspecificproblemorerror,andtheshortestcodenecessarytoreproducetheproblem.这将有助于其他人回答问题。关闭5年前。Improvethisquestion我需要删除除“|”以外的所有字符和字符串中的空格。我不明白如何在Go中执行此操作。请帮忙。字符串可能如下所示:|||||||||||||||||||||||||hello|我需要它来返回这个:||||||||||||||||||||||||||提前致谢!