dongmao7195 2016-04-04 20:27
浏览 137
已采纳

不支持的URL协议

I'm trying to create a basic GO app to pull a Git repo using git2go but I'm getting an error saying unsupported URL protocol. Does anyone know why?

package main

import (
    git "github.com/libgit2/git2go"
    "log"

)

func main() {

    cloneOptions := &git.CloneOptions{}

    repo, err := git.Clone("https://github.com/nova-framework/framework.git", "gittest", cloneOptions)
            if err != nil {
                    log.Panic(err)
            }
    log.Print(repo)
}
  • 写回答

1条回答 默认 最新

  • drl47263 2016-04-04 20:34
    关注

    Your libgit2 was probably not compiled with the required flags for HTTPS: https://github.com/libgit2/libgit2/blob/b7809b84692b4df7f11d603cc5da0860609e0555/src/transport.c#L32-L34

    The pre-processor is looking for one of these to be defined:

    GIT_OPENSSL, GIT_WINHTTP, GIT_SECURE_TRANSPORT
    

    From the README, it looks like you need these three, which probably cause the requirements to be met:

    ZLIB_LIBRARY, OPENSSL_SSL_LIBRARY AND OPENSSL_CRYPTO_LIBRARY: Tell CMake where to find those specific libraries

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能