1

Code, file structure on left and error

package main

import (
    "fmt"

    "github.com/cilium/cilium/api/v1/models"
    "github.com/cilium/cilium/pkg/client"
    log "github.com/sirupsen/logrus"
)

func main() {
    fmt.Println("Starting Application...")

    fmt.Println("Terminating Application...")
}

This is the error I get when I run: go run main.go

github.com/cilium/cilium@1.7.2 requires github.com/optiopay/kafka@v0.0.0-2080809090225-01ce283b732b: ivalid version: unknown revision 01ce283b732b

I am using go mod file for my dependencies and my go version is latest 1.14

I also checked my file structure and I already have cilium@v1.7.2 under pkg/mod/github.com/cilium

I tried adding github.com/optiopay/kafka under my import statement in my code but i get the same exact error still.

I have no idea how to fix this, I was googling but I could fin no definite or clear answer which worked. Any help appreicated.

4

2 回答 2

1

您看到此错误是因为/replace中的指令go.mod被忽略,并且Cilium v​​1.7.2 的文件包含许多替换指令。要解决此问题,请将您尝试导入的 Cilium 版本的替换指令复制到您自己的文件中。可以在此存储库中找到 Cilium v​​1.7 的示例。go modgo getgo.modgo.mod

于 2020-09-01T19:46:12.650 回答
0

似乎 optiopay/kafka 是您的私人回购。您可以使用 git 配置 ssh。并在 git config 中设置您的 url 以使用 ssh 而不是 https。

脚步:

  1. 配置 ssh(如果尚未完成)
  2. 更新 git 配置 -> git config --system url."git@github.com:".insteadOf "https://github.com/"
于 2021-07-06T13:49:02.680 回答