当前位置:网站首页>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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担.添加下方名片,即可获取全套学习资料哦
边栏推荐
- Carbon教程之 基本语法入门大全 (教程)
- NVIDIA has begun testing graphics products with AD106 and AD107 GPU cores
- Apache EventMesh distributed event-driven multi-runtime
- linux查看redis版本命令(linux查看mysql版本号)
- 程序员如何学习开源项目,这篇文章告诉你
- multithreaded lock
- C language parsing json string (json object is converted to string)
- leetcode 665. Non-decreasing Array 非递减数列(中等)
- [Code Hoof Set Novice Village 600 Questions] Merge two numbers without passing a character array
- 【AcWing】第 62 场周赛 【2022.07.30】
猜你喜欢

架构实战营模块八作业

ECCV 2022 Huake & ETH propose OSFormer, the first one-stage Transformer framework for camouflaging instance segmentation!The code is open source!...

How can we improve the real yourself, become an excellent architect?

Memblaze released the first enterprise-grade SSD based on long-lasting particles. What is the new value behind it?

Socket Review and I/0 Model

The principle of ReentrantLock (to be continued)

Count characters in UTF-8 string function

Three. Introduction to js

How programmers learn open source projects, this article tells you

顺序表的实现
随机推荐
BM3 flips the nodes in the linked list in groups of k
Cache and Database Consistency Solutions
【核心概念】图像分类和目标检测中的正负样本划分以及架构理解
leetcode 665. Non-decreasing Array
Apache EventMesh 分布式事件驱动多运行时
【PIMF】OpenHarmony 啃论文俱乐部—盘点开源鸿蒙三方库【3】
How programmers learn open source projects, this article tells you
BM5 merge k sorted linked lists
A shortcut to search for specific character content in idea
Unity 之 音频类型和编码格式介绍
flowable workflow all business concepts
【公开课预告】:超分辨率技术在视频画质增强领域的研究与应用
One thing to say, is outsourcing company worth it?
架构实战营模块 8 作业
multithreaded lock
高通cDSP简单编程例子(实现查询高通cDSP使用率、签名),RK3588 npu使用率查询
"The core concept of" image classification and target detection in the positive and negative samples and understanding architecture
ojdbc8 "Recommended Collection"uni-app中的renderjs使用
leetcode 665. Non-decreasing Array 非递减数列(中等)