golang的踩坑
title: golang 踩坑 date: 2018-08-14 20:10:55 tags:
- go
一
> x509 error when using HTTPS inside a Docker container
因為 docker 中沒有 CA 證書。
普通的映象解決辦法
FROM ubuntu:14.04.1
RUN apt-get update
RUN apt-get install -y ca-certificates
CMD curl https://www.google.com
如果是 alpine 的參考這個:
FROM docker.finogeeks.club/base/alpine
MAINTAINER "zhuzhenfeng@finogeeks.club"
RUN set -ex \
&& apk add --no-cache ca-certificates
COPY src/wallet/wallet /opt/wallet
ENTRYPOINT /opt/wallet
二
> panic: runtime error: invalid memory address or nil pointer dereference > [signal 0xb code=0x1 addr=0x38 pc=0x26df]
"An error is returned if caused by client policy (such as CheckRedirect), or if there was an HTTP protocol error. A non-2xx response doesn't cause an error.
When err is nil, resp always contains a non-nil resp.Body."
是 http 請求的時候,defer res.Body.Close() 引起的,應該在 err 檢查之後。
The defer
only defers the function call. The field and method are accessed immediately.
更多原創文章乾貨分享,請關注公眾號
- 加微信實戰群請加微信(註明:實戰群):gocnio
相關文章
- golang—踩坑之切片Golang
- golang的defer踩坑彙總Golang
- Golang 需要避免踩的 50 個坑Golang
- 踩了 Golang sync.Map 的一個坑Golang
- golang 介紹以及踩坑之四Golang
- golang定時任務踩坑及終極解決方案Golang
- GeoServer 踩過的坑Server
- Golang for range的坑Golang
- vue踩坑Vue
- 相容踩坑
- THEOS踩坑。。。
- Flutter 踩坑Flutter
- angular踩坑Angular
- protodep踩坑
- CDH踩坑
- 小程式踩坑填坑
- 改bug時踩的坑
- JasperReport 中踩過的坑
- MUI的踩坑筆記UI筆記
- ThinkPHP 的 nginx 配置踩坑PHPNginx
- laradock-的踩坑之旅
- 關於calc的踩坑
- Nginx的踩坑日記Nginx
- 又踩坑了!BigDecimal使用的5個坑!Decimal
- removeChild踩坑記REM
- Fragment-踩坑Fragment
- 小程式踩坑
- MQTT使用踩坑MQQT
- vue 踩坑記Vue
- GitLab CI 踩坑Gitlab
- mpvue“踩坑”指南Vue
- mpVue 踩坑記Vue
- phppresentation 踩坑指南PHP
- Homestead 配置踩坑
- 無限踩坑
- vuepress踩坑記Vue
- Auth::user() 踩坑
- cocoscreator踩坑01