1.下载SDK

https://golang.org/dl/
下载
go1.12.windows-amd64.zip
解压放到 C:盘

2.配置环境变量

GOROOT C:\Go
GOPATH   D:\GOPATH
GOPROXY   https://goproxy.cn (go mod 需要代理)
#配置PATH添加
%GOROOT%\bin\
%GOPATH%\bin\

验证

C:\go>go version
go version go1.12 windows/amd64C:\go>go env
C:\go>go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\xxx\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\GOPATH
set GOPROXY=https://goproxy.cn
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\xxx~1\AppData\Local\Temp\go-build304895266=/tmp/go-build -gno-record-gcc-switchesC:\go>

3.WindowsGCC

下载

x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z
https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/#readme

解压到D:\software\MinGW
配置环境变量 PATH添加

D:\software\MinGW\mingw64\bin\
C:\go>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=D:/software/MinGW/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-8.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/lib -L/c/mingw810/prerequisites/x86_64-zlib-static/lib -L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)C:\go>

4.github 拉取代码

#在GOPATH路径外从github克隆代码(go mod 需要)
git clone https://github.com/lifei6671/mindoc.git
#弃用dep管理软件包 改用mod
#执行
go mod initgo mod tidy
#在项目根目录生成go.mod文件

go.mod文件

module github.com/lifei6671/mindocgo 1.12require github.com/PuerkitoBio/goquery v1.4.1require github.com/astaxie/beego v1.10.1require github.com/boombuler/barcode v1.0.0require github.com/go-sql-driver/mysql v1.4.0 // indirectrequire github.com/kardianos/service v1.0.0require github.com/lifei6671/gocaptcha v0.1.1require github.com/mattn/go-sqlite3 v1.9.0require github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646require gopkg.in/ldap.v2 v2.5.1require (github.com/andybalholm/cascadia v1.2.0 // indirectgithub.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirectgithub.com/gomodule/redigo v2.0.0+incompatible // indirectgithub.com/howeyc/fsnotify v0.9.0github.com/lib/pq v1.9.0 // indirectgithub.com/shurcooL/sanitized_anchor_name v1.0.0 // indirectgolang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 // indirectgolang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7 // indirectgoogle.golang.org/appengine v1.6.7 // indirectgopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirectgopkg.in/russross/blackfriday.v2 v2.0.0gopkg.in/yaml.v2 v2.4.0 // indirect
)

5.dep (废弃)

https://github.com/golang/dep/releases
dep-windows-amd64.exe
重命名为dep.exe 放到%GOPATH%\bin\目录下

D:\GOPATH>dep version
dep:version     : v0.5.4build date  : 2019-07-01git hash    : 1f7c19ego version  : go1.12.6go compiler : gcplatform    : windows/amd64features    : ImportDuringSolve=false
D:\GOPATH>

5.启动

#在项目根目录执行
go build
#生成 mindoc.exe 文件
#复制conf\app.conf.example 为app.conf 修改数据库部分
#执行初始化
mindoc.exe install
#启动
mindoc.exe
#访问
localhost:8181

6. IDE goland配置

open 项目
配置环境变量GOROOT 、GOPATH、Go models


配置RUN

启动

7. 安装 calibre

下载功能依赖calibre组件
https://calibre-ebook.com/download

8.编译

set GOOS=linux
set GOARCH=amd64
go build -o mp_doc_linux_amd64 main.go

Golang 相关 mindoc开发相关推荐

  1. 来自滴滴平台的技术部架构师给大家做一些 golang 相关的分享和交流

    前言 我是来自滴滴平台的陶文,今天很高兴能够在这里给大家做一些 golang 相关的分享和交流,我的演讲主要分为三个模块: 一.为什么不手写测试? 二.流量录制和回放方案的取舍. 三.golang 实 ...

  2. Microsoft .NET Compact Framework 开发常见问题解答 - 专注.NET技术及其相关应用开发! - 博客园...

    Microsoft .NET Compact Framework 开发常见问题解答 发布日期: 3/30/2005 | 更新日期: 3/30/2005 Microsoft .NET Compact F ...

  3. 计算机相关的开发岗位

    计算机相关的开发岗位: 1.产品经理(8000-16000)--跟客户谈生意 2.架构师(11000-16000)      or  部门经理(8000)--关系户 3.项目经理(8000-15000 ...

  4. golang之网络开发

    TCP Server/Client开发 net包提供network I/O开发接口,包括TCP/IP.UDP.DNS和Unix domain sockets. 常用开发一般仅需要最基础接口或函数: 服 ...

  5. Golang队列中间件开发总结

    目前很多框架中都存在消息队列的中间件,例如ActiveMQ,RabbitMQ,ZeroMQ,Kafka等,基本都是封装好,足够我们使用.但是,我们如何自己去实现一个消息队列中间件呢? 由于公司需求,进 ...

  6. Golang Devops项目开发(1)

    1.1 GO语言基础 1 初识Go语言 1.1.1 开发环境搭建 参考文档:<Windows Go语言环境搭建> 1.2.1 Go语言特性-垃圾回收 a. 内存自动回收,再也不需要开发人员 ...

  7. Golang微服务开发实践

    github: github.com/yun-mu/Micr- 微服务概念学习:可参考 Nginx 的微服务文章 微服务最佳实践:可参考 微服务最佳实践 demo 简介 服务: consignment ...

  8. python游戏服务器框架_mqant首页、文档和下载 - Golang/python语言开发的分布式游戏服务器框架 - OSCHINA - 中文开源技术交流社区...

    mqant mqant 是一款基于 Golang 语言的简洁,高效,高性能的分布式游戏服务器框架,研发的初衷是要实现一款能支持高并发,高性能,高实时性的游戏服务器框架,也希望 mqant 未来能够做即 ...

  9. Golang服务端开发及微服务架构

    Go语言中使用panic和recover简化错误处理 Go语言中的单元测试及反向代理 Go获取命令行参数及信号量处理 Go各种类型转换及函数的高级用法 Go语言中Tcp协议粘包问题处理 Go操作mys ...

  10. Ubuntu安装及Ubuntu下常用软件安装(不断补充)及Windows相关--软件开发用途

    之前一直使用Window系统,现在工作中大家主流使用Ubuntu,同事帮忙装个Ubuntu系统,事后写一下安装过程,以备后续再次安装查阅. 1Ubuntu安装 1.1Ubuntu文件下载: Ubunt ...

最新文章

  1. 张正友相机标定代码(c++python)
  2. IOS 内存管理小结
  3. @import和@class的区别
  4. 关键帧动画html例子,Bounce.js 是一个漂亮的CSS3关键帧动画生成工具和类库_前端开发者...
  5. 如何注册鸿蒙id,鸿蒙系统真机调试证书 和 设备ID获取
  6. JQ ajax解决跨域
  7. RabbitMQ基础介绍
  8. 将视图状态存入数据库(3)
  9. 【渝粤教育】国家开放大学2018年秋季 0550-22T素描(一) 参考试题
  10. php出库单编号怎么编,求大神帮忙写VBA,出库单自动保存到明细,自动编号
  11. 数据治理之IT系统存量信息梳理
  12. Spire.Office for .NET 7.9.2 去掉license.dll注册功能
  13. Unity3D基础3:贴图与材质球
  14. Angular primeng tree 组件数据解析(适用于Angular2+)
  15. #每日一题 力扣第22题 黑白格子画
  16. 一文读懂数据库的文本数据类型:CHAR,VARCHAR,TEXT,BLOG,NCHAR、NVARCHAR、NTEXT
  17. “快准狠”找到系统内存的问题
  18. win10自动关机设置_电脑小技巧设置自动关机
  19. html箭头相关符号
  20. 汉语言文学专业c学校,理科生能报汉语言文学专业吗?哪些学校找理科生

热门文章

  1. C++ 实现计算24点
  2. sublime快捷键生成html5基本模板
  3. PHP集成环境:这些年我用过的那些PHP环境
  4. 个人时间和任务管理工具GTD大盘点!你适合哪一款?
  5. 上海链家网二手房成交数据爬取
  6. 关于Keil4 C51版本可以编译但是无法完成编译的问题解决
  7. 程序员转正答辩ppt
  8. 【1stopt】1stOpt的编程模式
  9. 金立android手机怎么截图,金立M6手机怎么截图 金立M6截屏/截图方法(两种)
  10. 编程实现对率回归,并给出西瓜数据集 3.0α 上的结果.