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 介紹以及踩坑之四Golang
- 踩了 Golang sync.Map 的一個坑Golang
- golang定時任務踩坑及終極解決方案Golang
- GeoServer 踩過的坑Server
- angular踩坑Angular
- 相容踩坑
- Flutter 踩坑Flutter
- vue踩坑Vue
- CDH踩坑
- THEOS踩坑。。。
- protodep踩坑
- 踩了的Dockerfile的坑Docker
- Golang for range的坑Golang
- 小程式踩坑填坑
- ThinkPHP 的 nginx 配置踩坑PHPNginx
- 改bug時踩的坑
- Nginx的踩坑日記Nginx
- MUI的踩坑筆記UI筆記
- 關於calc的踩坑
- phppresentation 踩坑指南PHP
- 小程式踩坑
- Fragment-踩坑Fragment
- removeChild踩坑記REM
- mpVue 踩坑記Vue
- vue 踩坑記Vue
- mpvue“踩坑”指南Vue
- MQTT使用踩坑MQQT
- Auth::user() 踩坑
- 無限踩坑
- vuepress踩坑記Vue
- IE 踩坑記
- laradock-的踩坑之旅
- 你踩過flutter的坑嗎Flutter
- Webpack的踩坑與彙總Web
- JasperReport 中踩過的坑