草庐IT

find_end

全部标签

go - --go_out : protoc-gen-go: The system cannot find the file specified Windows 10

我正在尝试使用此命令protocgreet\greetpb\greet.proto--go_out=plugins=grpc:。我收到了消息"--go_out:protoc-gen-go:Thesystemcannotfindthefilespecified."我的协议(protocol)版本是libprotoc3.6.1我的go版本go版本go1.11.2windows/386我的包列表中还有这个github.com/golang/protobuf/protoc-gen-go/grpc我是golang的新手,我正在尝试学习grpc。有人可以帮我解决这个问题吗?我正在使用Windows

go - "unexpected end of JSON input"当在 POST 请求中传递对象数组时

import"github.com/gin-gonic/gin"funcReceive(c*gin.Context){//GetsJSONecnodeddatarawData,err:=c.GetRawData()iferr!=nil{returnnil,err}logger.Info("Rawdatareceived-",rawData)}当我传递一个Json对象{"key":"value"}但出现错误时,此代码片段有效:"unexpectedendofJSONinput"当我传递像[{"key":"val"},{"key":"val"}]这样的数组作为输入时。

javascript - 保护 "back-end" Angular 源文件

我有一个Angular系统,它只与我的Go后端和Gorilla对话,我负责我的登录session。我开始处理我的管理环境,但我想知道保护它的Angular代码的最佳做法是什么。这对安全性来说并不是真正的问题,因为即使是管理代码也只有逻辑,而不是危险数据,但我仍然不希望它只对世界上的任何人开放。我正在考虑执行以下操作;我有一个mux路由器,它捕获我所有的资源调用(使用Yeoman部署),我想知道我会在那里为images/admin设置3个异常(exception),scripts/admin和styles/admin。只有当您有一个有效的session事件时,才能提供这些路径。否则抛出4

Golang Dockerfile : Unable to find packages in docker build but runs normally

我的golang微服务项目的多阶段构建有以下dockerfile设置FROMgolang:alpineasbuilderRUNapk--no-cacheaddgitWORKDIR/app/vessel-serviceCOPY..RUNgomoddownloadRUNCGO_ENABLED=0GOOS=linuxgobuild-a-installsuffixcgo-ovessel-service#SecondStage...我的main.go中有以下导入import("context""errors""fmt"pb"github.com/thededlier/go-micro-shipp

go - `go get` : unexpected end of JSON input

您使用的是哪个版本的Go(goversion)?$goversionv1.12模块yiigo有标签v3.0.0,但是当我运行gogetgithub.com/iiinsomnia/yiigo时,它会得到v2.1.0,当我运行gogetgithub.com/iiinsomnia/yiigo@v3.0.0,它显示:gogetgithub.com/iiinsomnia/yiigo@v3.0.0:unexpectedendofJSONinput 最佳答案 主要问题似乎是iiinsomnia/yiigo的v3.0.0版本缺少必需的/v3在mod

ssl - ListenAndServerTLS 一直失败,错误为 : failed to find any PEM data in certificate input

我从Godaddy为网站购买了SSL证书。我在服务器中添加文件并运行该服务,它只返回一个错误:failedtofindanyPEMdataincertificateinput我使用cat生成了一个包含所有文件的server.pem文件,甚至添加了一个他们为G2证书链提供的godaddypem中间pem文件,什么也没有。catgenerated-private-key.txt>server.pemcat678f65b8a7391017.crt>>server.pemcatgd_bundle-g2-g1.crt>>server.pemcatgdig2.crt.pem>>server.pem

go build 命令行参数 : open NUL: Can not find the specified file

我有麻烦了,当我尝试启动任何.go应用程序时出现此错误:C:\Go12\test>go运行cmp.gogobuildcommand-line-arguments:openNUL:找不到指定的文件。C:\Go12\test>去环境设置GOARCH=386设置GOBIN=C:\going\bin\设置GOCHAR=8设置GOEXE=.exe设置GOHOSTARCH=386设置GOHOSTOS=windows设置GOOS=windows设置GOPATH=C:\going\设置GORACE=设置GOROOT=C:\Go12设置GOTOOLDIR=C:\Go12\pkg\tool\windows

angularjs - go gorilla/sessions angularjs and path, session values not saved (find the bug/place the blame)

好的,从哪里开始...问题是当我将session的Path设置为"/"时,session没有保存。我设置了Path因为当发布到一个不是session保存路径的路径时,又名session.Save()被称为session值“用户”为空|无|未设置。所以我设置了Path:"/",但session没有保存。检查Chromium时,我看到cookie已设置。我不知道问题出在哪里。它在gorilla/session中吗?它在AngularJS中吗?HTML5模式已关闭。换句话说,发生这种情况是因为/api/1.0/community与/api/1.0/user的路径不同,其中sessions.S

mongodb - mgo.v2 Find().Select().One() 返回空白

mongoshell输出>db.departments.find(){"_id":ObjectId("5733b051e444917f9d273ce6"),"id":"5733b05157659a11a4589102","brandid":"1","name":"first","managerid":"0","users":["1","2","3","7"]}该函数将depID作为输入,我验证了它应该是什么,即5733b05157659a11a4589102funcGetUsers(depIDstring)(*department.UsersResp,error){if!bson.Is

Golang 初学者,Windows : System cannot find file specified

刚开始接触golang,之前只有少量的编程经验。我正在尝试创建一个脚本来总结csv文件中的某些内容,但我什至还没有通过文件读取测试。我在读取excel文件时遇到问题,并不断收到“系统找不到指定的文件”错误。所以我想看看我是否至少可以让它读取一个简单的文本文件,使用golangbot的示例,如下所示:packagemainimport("fmt""io/ioutil")funcmain(){data,err:=ioutil.ReadFile("test.txt")iferr!=nil{fmt.Println("Filereadingerror",err)return}fmt.Printl