hcache编译安装 && fatal: unable to access 'https://github.com/tobert/pcstat/': SSL connect error

本文介绍了如何获取并编译hcache源代码,包括安装go环境,解决在执行go get时遇到的SSL连接错误和golang.org访问问题。通过设置git配置、手动下载缺失包和调整导入路径,最终成功编译出hcache的可执行文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 获取hcache源代码:

wget https://github.com/silenceshell/hcache/archive/master.zip

unzip master

2.安装go

hcache要求go的版本不得低于1.4.本次使用go1.7

 wget https://dl.google.com/go/go1.7.6.linux-amd64.tar.gz

tar zxvf go1.7.6.linux-amd64.tar.gz

mv go /usr/local

vi ~/.bash_profile

添加如下语句:

export GOROOT=/usr/local/go

export PATH=$PATH:$GOROOT/bin

而后执行: source ~/.bash_profile即可。

3. build

cd hcache_master

export GO_PATH = {hcache_master的路径}

go get github.com/tobert/pcstat

此时可能会报如下错误:

正克隆到 '/home/sys_test/hcache-master/src/github.com/tobert/pcstat'...
fatal: unable to access 'https://github.com/tobert/pcstat/': SSL connect error
package github.com/tobert/pcstat: exit status 128

需要设置:

git config --glob

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值