首页 > 其他分享 >Go - ERROR: # command-line-arguments undefined

Go - ERROR: # command-line-arguments undefined

时间:2023-09-08 23:44:55浏览次数:33  
标签:github undefined lib Go pq command arguments go com

zzh@ZZHPC:/zdata/MyPrograms/Go/aaa/Ch05/05_04$ go run httpd.go
# command-line-arguments
./httpd.go:15:9: undefined: DB
./httpd.go:58:16: undefined: NewDB

zzh@ZZHPC:/zdata/MyPrograms/Go/aaa/Ch05/05_04$ go run *.go
2023/09/08 23:29:15 error: sql: unknown driver "postgres" (forgotten import?)
exit status 1
zzh@ZZHPC:/zdata/MyPrograms/Go/aaa/Ch05/05_04$ go get github.com/lib/pq
go: downloading github.com/lib/pq v1.10.9
go: added github.com/lib/pq v1.10.9

 

Two files contain "package main", one file can't call the other file's things. To resolve the first error, you must go run *.go.

 

To resolve the second error, first run 'go get github.com/lib/pq', then add '_ "github.com/lib/pq"' in import.

标签:github,undefined,lib,Go,pq,command,arguments,go,com
From: https://www.cnblogs.com/zhangzhihui/p/17688759.html

相关文章

  • Revit二次开发-获取RevitCommandId
      在revit二次开发中,如果需要用到调用原生功能或者某个插件的功能。我们可以用UIApplication.PostCommand这个方法来调用一些RevitCommand来实现这个需求。   但是PostableCommand这个枚举提供的commandid比较少只有一些常用且原生的RevitCommand。如果我们的需求......
  • 【设计模式】命令模式Command:在一次请求中封装多个参数
    (目录)命令模式使用频率不算太高。如果熟悉函数式编程的话,会发现命令模式完全没有使用的必要,甚至在业务开发的场景中也很少使用到。不过对于想要找到正确抽象的设计者来说,命令模式的设计思想却非常值得借鉴。命令和查询的区别:查询,获取一个不可变的结果;命令,改变状态,不一定获......
  • 安防教育直播项目应用中RTSPSever组件libEasyRTSPServer编译arm版本报undefined refer
    大家知道我们团队编译过很多产品的ARM版本,对用户来说,多一种编译方式也是多一种选择,所以我们一直在拓宽TSINGSEE青犀视频全线产品的运用范围。近期TSINGSEE青犀视频研发团队编译了libEasyRTSPServer的ARM版本,在此过程中,我们遇到了编译错误undefinedreferenceto`uselocale’。libE......
  • Mac 终端登陆MySQL出现“zsh:command not found: mysql”的问题
    mysql明明安装好了,而且也登陆使用过了,但是这次在终端登陆却报错这个问题。其实上次也报错这个一样的问题,我觉得可能是环境配置没有弄好,重新检查和source生效了下(source~/.bash_profile),此时mysql能正常登陆了;但是退出终端后再次登陆又会报同样的问题。感觉不对劲了,只能生效一次......
  • bash: pip3: command not found...
     001、问题[root@pc1test01]#pip3--version 002、解决方法a、[root@pc1test01]#yum-yinstallepel-release b、[root@pc1test01]#yuminstallpython3-pip-y 003、测试[root@pc1test01]#pip3--versionpip9.0.3from/usr/lib/python3.6......
  • Uchardet C++源码编译步骤 文本编码检测命令行工具 Command line
    从官网 https://www.freedesktop.org/wiki/Software/uchardet/下载源码 https://www.freedesktop.org/software/uchardet/releases/=====================================================================================下载编译工具:Cmake和mingw64https://cmake.org......
  • this.onMetaChange is undefined和Ext.Container.LAYOUTS[this.layout.toLowerCase()]
    由于现在公司所有项目开发要用ExtJS来做前台展示,所以不得不自学,不然就得面临被自我淘汰了。估计可能报同样的错但却不是同样的原因,不过保存下来还是可以作为下一次寻找原因的第一思路。^_^1、报错:this.onMetaChangeisundefinedhttp://localhost:8080/ExtStudy/extjs/ext-all.jsL......
  • Homebrew安装cocoapods: zsh: command not found: brew解决方法
    问题描述:通过Homebrew安装cocoapods时,输入命令行 brewinstallcocoapods出现如下报错:zsh:commandnotfound:brewzsh:找不到命令:brew 问题解决:使用以下命令,重新安装Homebrew./bin/zsh-c"$(curl-fsSLhttps://gitee.com/cunkai/HomebrewCN/raw/master/Homeb......
  • homebrew安装软件出现git问题fatal: not in a git directory,Error: Command failed w
    homebrew安装软件出现git问题问题fatal:notinagitdirectoryError:Commandfailedwithexit128:git问题查找1.brew-v查看问题logsuyf@suyfdeMac-mini~%brew-vHomebrew4.0.18-18-g64259a4fatal:detecteddubiousownershipinrepositoryat'/op......
  • 删除文件报错rm: cannot remove `auditcommand.log': Operation not permitted
    删除文件报错[root@db1log]#rm-rfauditcommand.logrm:cannotremove`auditcommand.log':Operationnotpermittedlsattr查看属性[root@db1log]#rm-rfauditcommand.logrm:cannotremove`auditcommand.log':Operationnotpermitted[root@db1log]#lsat......