当前位置:网站首页>Golang - from entry to abandonment
Golang - from entry to abandonment
2022-07-31 21:12:00 【m0_67401228】
文章目录
一、golang 简介

Go 是一个开源的编程语言,它能让构造简单、可靠且高效的软件变得容易
Go是从2007年末由Robert Griesemer, Rob Pike, Ken Thompson主持开发,后来还加入了Ian Lance Taylor, Russ Cox等人,并最终于2009年11月开源,在2012年早些时候发布了Go 1稳定版本.现在Go的开发已经是完全开放的,并且拥有一个活跃的社区.
中文网在线标准库文档
1. go 语言特点
- 天生支持并发
- 语法简单,容易上手
- 内置runtime,支持垃圾回收
- 可直接编译成机器码,不依赖其他库
- 丰富的便准库
- 可跨平台编译
- 部署维护成本低
2. go 语言应用领域
- 服务器编程
- 开发云平台
- 区块链
- 分布式系统
- 网络编程
3. 使用 go 语言的公司有哪些
Google
k8sFacebook
facebookgo腾讯
蓝鲸平台
容器技术百度
运维项目BFE京东
消息推送系统、云存储、京东商城小米
运维监控系统、小米互娱、小米商城、小米视频、小米生态链360
日志搜索系统Poseidon
二、安装 golang
1. golang 下载安装


2. 配置环境变量





使用cmd查看配置是否成功
三、golang 开发工具
1. 安装 VSCode





使用vscode打开创建的项目文件并选择信任

2. 下载所需插件
下载go扩展插件
下载Code Runner插件
安装常用工具包
可以看到这里会下载失败,因为是外网的资源,所以需要进行配置

添加代理地址
配置 GOPROXY 环境变量
GOPROXY = "https://proxy.golang.com.cn,direct"

关闭module功能
GO111MODULE=off
无模块支持,go命令行将不会支持module功能,寻找依赖包的方式将会沿用旧版本那种通过vendor目录或者GOPATH模式来查找.




四、第一个 golang 应用
//主包,可执行文件所在包
package main
//导入包
import "fmt"
//主函数,入口函数
func main() {
//打印输出
fmt.Println("hello go")
}
//输出结果
hello go
1. main 包的含义
- 在 Go 语言里,命名为 main 的包具有特殊的含义.Go 语言的编译程序会试图把这种名字的包编译为二进制可执行文件.
- 所有用 Go 语言编译的可执行程序都必须有一个名叫
main的包 - 一个可执行程序有且仅有一个
main包 - 当编译器发现某个包的名字为
main时,它一定也会发现名为main()的函数,否则不会创建可执行文件 main()函数是程序的入口,所以,如果没有这个函数,程序就没有办法开始执行- 程序编译时,会使用声明
main包的代码所在的目录的目录名作为二进制可执行文件的文件名
2. 示例


先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在.深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小.自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前.因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担.添加下方名片,即可获取全套学习资料哦
边栏推荐
- MATLAB program design and application 2.4 Common internal functions of MATLAB
- flowable workflow all business concepts
- Count characters in UTF-8 string function
- npm 更改为淘宝镜像的方法[通俗易懂]
- BM5 合并k个已排序的链表
- linux查看redis版本命令(linux查看mysql版本号)
- 给定一个ip地址,子网掩码怎么算网络号(如何获取ip地址和子网掩码)
- Chapter VII
- Qualcomm cDSP simple programming example (to query Qualcomm cDSP usage, signature), RK3588 npu usage query
- Redis Overview: Talk to the interviewer all night long about Redis caching, persistence, elimination mechanism, sentinel, and the underlying principles of clusters!...
猜你喜欢

Short-circuit characteristics and protection of SiC MOSFETs

ThreadLocal

Efficient Concurrency: A Detailed Explanation of Synchornized's Lock Optimization

Arduino框架下STM32全系列开发固件安装指南

Tkinter 入门之旅

Redis Overview: Talk to the interviewer all night long about Redis caching, persistence, elimination mechanism, sentinel, and the underlying principles of clusters!...

Getting Started with Tkinter

第七章

Basic configuration of OSPFv3

Financial profitability and solvency indicators
随机推荐
npm 更改为淘宝镜像的方法[通俗易懂]
The whole network is on the verge of triggering, and the all-round assistant for content distribution from media people - Rongmeibao
The old music player WinAmp released version 5.9 RC1: migrated to VS 2019, completely rebuilt, compatible with Win11
Thymeleaf是什么?该如何使用。
使用 Flutter 和 Firebase 制作!计数器应用程序
A solution to the server encountered an internal error that prevented it from fulfilling this request [easy to understand]
【论文精读】iNeRF
leetcode: 6135. The longest ring in the graph [inward base ring tree + longest ring board + timestamp]
[PIMF] OpenHarmony Thesis Club - Inventory of the open source Hongmeng tripartite library [3]
Realize serial port receiving data based on STM32 ring queue
uni-app中的renderjs使用
架构实战营模块八作业
每月一书(202207):《Swift编程权威指南》
求n以内的素数
Bika LIMS open source LIMS set - use of SENAITE (detection process)
Short-circuit characteristics and protection of SiC MOSFETs
PCB stackup design
第六章
-xms -xmx(information value)
架构实战营模块 8 作业