草庐IT

local-user

全部标签

mysql - 启用远程 MySQL 连接 : ERROR 1045 (28000): Access denied for user

运行在WindowsXP上的MySQL5.1.31。从本地MySQL服务器(192.168.233.142)我可以以root身份连接,如下所示:>mysql--host=192.168.233.142--user=root--password=redacted从远程机器(192.168.233.163),我可以看到mysql端口是打开的:#telnet192.168.233.1423306Trying192.168.233.142...Connectedto192.168.233.142(192.168.233.142).但是当尝试从远程机器连接到mysql时,我收到:#mysql--

go - 构建命令行参数 : cannot load local package: cannot find module providing package

我无法使用gomod加载本地包。我有单独的go.mod文件用于repoA和repoB。我在任何地方都找不到解决方案。操作系统是windows。$>goversiongoversiongo1.12.7windows/amd64当我从repoA运行主文件时,我有两个带有存储库的模块。它将尝试查找repoB的模块/包,然后抛出一个错误提示cannotfindmoduleprovidingpackage我的repo结构:-����repoA�����proto������system�����sauth�����shandle�����smodel�����sresponse����repoB

user-interface - 隐藏窗口删除所有内容后显示

我正在使用以下代码生成一个带有按钮的主窗口来打开其他窗口。我希望能够反复隐藏和显示其他窗口。关闭主窗口应该退出程序:packagemainimport("github.com/andlabs/ui")funcmain(){ui.Main(makeAllWins)}varmainWindow*ui.WindowvarotherWindow*ui.WindowfuncmakeAllWins(){makeMainWin()makeOtherWin()mainWindow.Show()}funcmakeMainWin(){varotherButton=ui.NewButton("Othermo

mongodb - mgo collection.Find(nil).All(&users) 不工作

我有下一个问题..我无法从我的mongo数据库(在docker容器中运行)中获取所有记录,这是我非常简单的代码:typeUserstruct{Emailstring`json:"email"bson:"email"`Passstring`json:"pass"bson:"pass"`}session:=dbConnect()collection:=session.DB("my_db").C("users")varusers[]Usererr:=collection.Find(nil).All(&users)iferr!=nil{log.Fatal("Mongocollectionfin

testing - echo c.Get ("user") 在测试环境中不起作用

我正在尝试测试基于echo框架/路由器构建的golangAPI。我有以下测试......funcTestLogout(t*testing.T){loadConfig()db:=stubDBs(t)Convey("Whenyoupostto/logout",t,func(){Convey("withavalidtoken,youshouldgetaasuccessmsgandbeloggedout",func(){e:=echo.New()e.Use(middleware.JWTWithConfig(middleware.JWTConfig{SigningKey:[]byte("secr

dockerfile install go local packages 可以吗?

我正在尝试使用我的golang项目创建一个docker镜像。该项目有一些本地包,例如math:/myproject/src/main.goutils/math.go在main.go中,我包含了很多包,还有来自math.go的math。我的docker文件看起来像这样:FROMgolang:latestENVGOPATH=/golib/RUN/usr/local/go/bin/gogetgithub.com/julienschmidt/httprouterCMD/usr/local/go/bin/gorunmain.goEXPOSE10004因为它是一个本地包,所以我如何包含math包,

go - 云存储 : unable to upload any content while local with golang

我有这段代码:ctx:=context.Background()cliente,err:=storage.NewClient(ctx)iferr!=nil{log.Fatal(err)}clienteCS:=cliente.Bucket("prueba123456789")w:=clienteCS.Object("prueba").NewWriter(ctx)w.ContentType="text/plain"if_,err:=w.Write([]byte("abcde\n"));err!=nil{log.Fatal(err)}attrs,err:=clienteCS.Attrs(ct

go - standard_init_linux.go :207: exec user process caused "no such file or directory" while trying to statically link c libs

我无法在go中对用c编写的实用程序进行docker化和使用。我已经在没有docker的情况下在本地运行了这个程序并且它有效我尝试像这样使用gccgogobuild-compilergccgo-gccgoflags-static-libgo但我得到了同样的错误调用C函数的序言如下所示:/*#cgoamd64x86LDFLAGS:-L.-lsomelib-lsomeotherlib#include#include#include"someheader.h"*/我的docker文件如下所示:FROMgolang:1.12ASbuildWORKDIR/go/src/appCOPY..ENVGO

docker - 从 Ubuntu amd64 到 arm7l : exec user process caused "exec format error" 进行交叉编译

从amd64到arm7l的交叉编译让我头疼我终于可以用GitlabCI做到这一点,所以现在,我在docker镜像中编译我的二进制文件,这是dockerfile:FROMgolangWORKDIR/go/src/gitlab.com/company/edge_to_bcCOPY..RUNdpkg--add-architecturearmhf&&aptupdate&&apt-getinstall-ygcc-arm-linux-gnueabihflibltdl-dev:armhf我将其构建为然后我将使用名称ubuntu:cross-compil构建新容器“cross-compil”现在,我可

user-interface - 增加这个简单的 go gui 应用程序的默认字体大小

我正在使用以下简单的演示代码来使用Fyne创建一个GUI包:packagemainimport("fyne.io/fyne/widget""fyne.io/fyne/app")funcmain(){app:=app.New()w:=app.NewWindow("Hello")w.SetContent(widget.NewVBox(widget.NewLabel("HelloFyne!"),widget.NewButton("Quit",func(){app.Quit()}),))w.ShowAndRun()}一切正常,但我想增加此GUI的默认字体大小(以便标签、按钮和任何其他小部件(如