- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
由于这个错误,我似乎无法运行我的 go 代码
non-standard import "gopkg.in/olivere/elastic.v5" in standard package "goprojects/search"
Main.go 位于:C:\Go\src\goprojects\search\main.go
GOROOT 是 C:\Go
GOPATH 是 C:\Go\src\goprojects(尝试在此处添加我当前的工作目录\search,但没有帮助)
当我运行“go get gopkg.in/olivere/elastic.v5”时,我在 C:\Go\src\goprojects\src\gopkg.in\olivere\elastic.v5 中得到导入的文件
visual studio code 给我这条信息
cannot find package "go.pkg.in/olivere/elastic.v5" in any of:
C:\Go\src\vendor\gopkg.in\olivere\elastic.v5 (vendor tree)
C:\Go\src\gopkg.in\olivere\elastic.v5 (from $GOROOT)
C:\Go\src\goprojects\src\gopkg.in\olivere\elastic.v5 (from $GOPATH)
我的代码
package main
import (
"fmt"
"net/http"
elastic "gopkg.in/olivere/elastic.v5"
)
func main() {
http.HandleFunc("/search", search)
http.ListenAndServe(":3000", nil)
}
func search(w http.ResponseWriter, r *http.Request) {
searchString := r.URL.Query().Get("q")
fmt.Println("Searching for" + searchString)
// Create a client
client, err := elastic.NewClient()
w.Write([]byte(searchString))
}
最佳答案
将我的 goprojects 从我的 GoRoot 路径移到 C:\goprojects 中的一个单独的文件夹中,并用新路径替换了我的 GoPath,它工作了。
关于go - 标准包窗口中的非标准导入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46140491/
我正在编写一个程序,它必须规范化音频 *.wav 文件。有一个“显示头部数据”的任务:ChunkId、ChunkSize 等等。 我想创建一个名为display_hdr 的函数(为了减少main.c
我有一个带有缩放类的 css 文件:1。 我在浏览器控制台上收到以下错误。 此页面使用非标准的“缩放”属性。相反,您可以将 calc() 或“transform”与“transform-origin:
我想模拟来自非标准密度函数的数据。我已经找到以下链接( How do I best simulate an arbitrary univariate random variate using its
使用已安装的 JDK 版本时,默认系统语言环境报告正确,但当我使用 adoptopenjdk-11 时tar.gz ,总是报告为en_US import java.util.Locale; publi
我如何强制 automake 为非标准 C++ 后缀文件生成依赖项跟踪?特别是我的意思是生成 .deps 目录文件内容。我也在使用 libtool。 谢谢 最佳答案 看看this section in
我有一个快速解决方法的问题,以享受非标准 gnu 的好处 case ranges .例如,非标准: case 1 ... 5: 可以替换为: case 1: case 2: case 3: case
我有两个“日期”字段需要加入。 第一个是格式为 yyyy-mm-dd hh:mm:ss 的普通日期时间 第二个是红头步骤子格式的 varchar(8) mmddyyyy 现在这变得很痛苦,因为没有简单
我有一个符合以下约定的 CSV val1,val2,outerStruct1{valA,valB,innerStruct2{valX, valY},valC},... 问题是当我尝试正则表达式oute
我有数据列: id name type number 1 n1 t1 num1 2 n2 t1 num2 3 n3 t1 num3 4
我正在为 Shelly 系列设备开发 openHAB2 绑定(bind)。 http接口(interface)运行良好,但无法注册获取COAP事件。 有人有使用 Californium 框架的经验吗?
我在 UILabel 上显示商标“TM”字符时遇到了一些问题。 出现问题的“TM”字符是\U0099 而不是通常的\U2122 稍微深挖一下,发现“TM”字\U0099属于极少数的汉字。 所以我猜 i
请原谅我的无知,我是 c++ 的新手。 完整错误信息: coog.cpp(74): error C3867: 'Manager::start_foo': 非标准语法;使用“&”创建指向成员的指针 我正
我有一个可以生成如下 JSON 的 API: )]}', { //JSON DATA } //JSON DATA 是有效的 JSON,但顶部的 )]}', 不是。 当我尝试通过逻辑应用获取此数
我尝试使用 Apache Ant Get task获取我们公司另一个团队生成的 WSDL 列表。他们将它们托管在 http://....com:7925/services/ 上的 weblogic 9
我在 Google App Engine 上有一个 servlet,它从页面获取文本,将其存储为实体,然后将其发送回客户端。当我存储“You're”一词时,它会像平常一样在 GAE 本地存储中显示为“
这个问题在这里已经有了答案: Is there a way to access the underlying container of STL container adaptors? (10 个答案
我在编译这段代码时遇到了问题: void MyClass::MyMethod(Type * new_ptr) { myInternalUniquePtr_->swap(std::unique_
我有两个 Eigen::VectorXd 对象,A 和 B,具有相同的维度 n。 我想创建一个新的 vector C,这样: 如果 B[i] 是 NaN,则 C[i] = A[i] 否则:C[i] =
在 C++ 中,以这种格式向日期添加一天的最简单方法是什么: “20090629-05:57:43” 可能使用 Boost 1.36 - Boost::date、Boost::posix_date 或
我正在使用 Apache HTTPComponents 4.3 的 HttpCore 库编写一个 HTTP 服务器( java )。我的服务器必须能够接收具有非标准 HTTP 方法(GET、POST、
我是一名优秀的程序员,十分优秀!