Go语言(Golang)最初是由Robert Griesemer, Rob Pike, 和 Ken Thompson在谷歌于2007年开发出来的编程语言。Go编程语言是静态类型语言,语法类似于C语言,它提供了垃圾收集,类型安全,动态的输入能力,还有很多先进的内置类型,例如,可变长度数组和映射(键-值对)。它还提供了丰富的标准库。

Go编程语言是在2009年11月正式对外发布,主要是应用谷歌的于一些生产系统链中。

设计原理

  • 支持环境采取的模式类似于动态语言。例如:类型推断(x := 0是有效的int类型变量x的声明)

  • 编译时快

  • 内置的并发支持:轻量进程(通过),通道,select语句。

  • 简炼,简单和安全

  • 支持的接口类型和嵌入

  • 产生没有外部的依赖静态链接的本机二进制文件

特点

为了保持语言的简洁和简单,按照类似的语言省略常用的功能。

  • 不支持类型继承

  • 不支持任何方法或运算符重载

  • 不支付包之间循环依赖

  • 不支持对指针运算

  • 不支持断言

  • 不支持泛型编程

Go语言程序

Go语言程序可以从3行到数百万行,代码通过是写入到一个或多个扩展名“.go”的文本文件。例如,hello.go。您可以用“vi”,“vim”或任何其他文本编辑器来编写Go程序到到文件中。

下面是一个简单的Go入门程序, hello-world.go 的完整代码如下所示 -

package mainimport "fmt"func main() {
    fmt.Println("hello world")}Go

执行上面代码,将得到以下输出结果 -

$ go run hello-world.go
hello worldBash

本教程假设读者都知道如何使用编辑器编写一个文本文件和代码,以及如何在文件中编写一个程序的源代码。


874阅读 | 0评论
你的回应
  • voxoqukuvo

    2019-09-06 16:10:06 voxoqukuvo

    The ntt.riod.osbaike.net.oia.kw rebuild [URL=http://cerisefashion.com/zoloft/]zoloft[/URL] [URL=http://solepost.com/cheap-cialis/]cialis 20[/URL] [URL=http://modreview.net/retin-a/]retin a cream[/URL] [URL=http://meetatsonoma.com/amoxicillin/]amoxicillin 500 mg[/URL] [URL=http://secretsofthearchmages.net/prilosec/]generic prilosec[/URL] [URL=http://iliannloeb.com/rosuvastatin/]rosuvastatin[/URL] rosuvastatin [URL=http://freemonthlycalender.com/inderal/]inderal canada[/URL] donation verbally captopril, zoloft for

  • eqimajuhice

    2019-09-02 22:44:04 eqimajuhice

    Insert zie.zkjs.osbaike.net.byr.ic words; [URL=http://charlotteelliottinc.com/kamagra/]kamagra[/URL] [URL=http://cgodirek.com/digoxin/]digoxin lowest price[/URL] [URL=http://ralstoncommunity.org/lasix/]lasix online[/URL] [URL=http://sallyrjohnson.com/buy-prednisone/]prednisone[/URL] [URL=http://telugustoday.com/benemid/]buy benemid[/URL] [URL=http://myquickrecipes.com/viagra/]price of 100mg viagra[/URL] [URL=http://cgodirek.com/aciphex/]aciphex lowest price[/URL] secondary, reheat k

  • eqolfou

    2019-08-26 13:57:32 eqolfou

    Most mwp.xxcq.osbaike.net.idc.mc elastic, step, [URL=http://wellnowuc.com/lasix/]lasix online[/URL] [URL=http://solepost.com/cialis-20-mg-price/]lowest price for cialis 20 mg[/URL] [URL=http://sbmitsu.com/penegra/]penegra without dr prescription[/URL] [URL=http://vintagepowderpuff.com/cialis/]cialis 10mg[/URL] [URL=http://rockymountainmbaa.com/cialis-com/]cialis.com lowest price[/URL] [URL=http://passagesinthevoid.com/xalatan/]online xalatan[/URL] [URL=http://puresportsnetwork.com/buy-propecia-online/]propecia[/URL] albumin radicals, protruded

  • SuperSlotsswedy

    2019-08-25 01:58:22 SuperSlotsswedy

    Доброго времени суток! Не упустите момент получить самые "новые предложения" проекта игорного заведения Casino-X! [b]Казино онлайн Casino-X доступен на любом языке[/b] и для самых актуальных стран! [b]Азартный клуб - зеркало Casino-X - [/b][url=https://cosino-x.xyz/][b]Бесплатный сувенир ради регу[/b][/url] [b]Пример игры - можно играть сразу на этом сайте без регистрации и бесплатно - ЖМИ НА КАРТИНКУ ИГРЫ[/b] Рекомендую [URL=https://zdes-kino.ru/]фильмы хорошего каче

  • owiwaci

    2019-08-11 15:43:17 owiwaci

    Emergency nnw.axxb.osbaike.net.txd.mb inadvertent [URL=http://discoveryshows.com/cialis-soft/]buy cialis soft[/URL] cialis soft lowest price [URL=http://gaiaenergysystems.com/dapoxetine/]priligy[/URL] [URL=http://discoveryshows.com/viagra-soft/]viagra soft online[/URL] [URL=http://elegantearthatthearbor.com/valtrex-online/]valtrex neck ache[/URL] [URL=http://vintagepowderpuff.com/viagra-online/]buy viagra online[/URL] viagra for sale [URL=http://davincipictures.com/kamagra/]buy kamagra online[/URL] [URL=http://earthbeours.com/cialis-canadian-pharmacy/]generic cialis canadian pharmacy[/URL] [URL=http://davincipictures.com/viagra-buy-in-canada/]cheep viagra[/URL] enhancing warm, cialis soft lowest price priligy dapoxetine order viagra soft online valtrex online viagra cheap kamagra buy cialis online canada pharmacy generic viagra 50 mg hidden http://discoveryshows.com/cialis-soft/ cialis soft http://gaiaenergysystems.com/dapoxetine/ dapoxetine online http://discoveryshows.com/viagra-soft/ viagra soft online http://elegantearthatthearbor.com/valtrex-online/ valtrex online valtrex online http://vintagepowderpuff.com/viagra-online/ viagra for sale http://davincipictures.com/kamagra/ kamagra http://earthbeours.com/cialis-canadian-pharmacy/ on line pharmacy http://davincipictures.com/viagra-buy-in-canada/ v

  • abmirecafiuma

    2019-08-03 22:57:41 abmirecafiuma

    The ifl.rsjk.osbaike.net.hgg.gj oesophagectomy; periosteal [URL=http://washingtonsharedparenting.com/lisinopril/]personal injury lisinopril[/URL] [URL=http://jacksfarmradio.com/ventolin-inhaler-for-sale/]ventolin inhaler[/URL] [URL=http://buckeyejeeps.com/super-kamagra/]super kamagra generic[/URL] [URL=http://bikramcentennial.com/indocin/]indocin colchicine[/URL] [URL=http://puresportsnetwork.com/pharmacy/]pharmacy[/URL] [URL=http://mrcpromotions.com/rulide/]online rulide[/URL] [URL=http://fitnesscabbage.com/cialis-com-lowest-price/]cialis tadalafil 20 mg ta

  • ukudalvuwope

    2019-07-23 21:40:42 ukudalvuwope

    Other qjb.qdng.osbaike.net.avb.yh space-occupying [URL=http://timoc.org/viagra-online/]viagra.com[/URL] [URL=http://nicaragua-magazine.com/viagra-100mg/]viagra canada[/URL] [URL=http://nicaragua-magazine.com/viagra/]viagra[/URL] [URL=http://timoc.org/prednisone-20-mg/]prednisone[/URL] [URL=http://earthbeours.com/viagra-generic/]viagra[/URL] [URL=http://nicaragua-magazine.com/viagra-online/]viagra 100mg price walmart[/URL] [URL=http://dead-fish.com/buy-cialis/]cialis online[/URL] [URL=http://thebestworkoutplan.com/tadalafil-20-mg/]buy tadalafil online[/URL] cialis generic 20 mg [URL=http://nicaragua-magazine.com/cialis-20-mg/]cialis.com[/URL] irrespective viagra for sale viagra canada cheap viagra deltasone and pregnancy category cheap viagra pills canadian viagra cialis prezzo farmacia cialis lowest price for cialis 20 mg cialis 20 mg fasciculus non-pregnant parasite http://timoc.org/viagra-online/ viagra generic paypal http://nicaragua-magazine.com/viagra-100mg/ viagra on line http://nicaragua-magazine.com/viagra/ buy viagra online http://timoc.org/prednisone-20-mg/ prednisone 10 mg http://earthbeours.com/viagra-generic/ online viagra http://nicaragua-magazine.com/viagra-online/ viagra online http://dead-fish.com/buy-cialis/ cialis from canada http://t

  • enuuxadled

    2019-07-12 08:47:21 enuuxadled

    It xpu.gfhw.osbaike.net.bev.ov conducting [URL=http://heavenlyhappyhour.com/fluoxetine/]fluoxetine lowest price[/URL] [URL=http://quotes786.com/vidalista/]potenzmittel ginerika vidalista[/URL] [URL=http://iowansforsafeaccess.org/tadalafil-20-mg/]cialis 20 mg[/URL] [URL=http://disclosenews.com/revia/]price of revia[/URL] [URL=http://heavenlyhappyhour.com/vidalista/]vidalista[/URL] [URL=http://bootstrapplusplus.com/cialis-5mg/]cialis 10mg[/URL] [URL=http://thefashionhob.com/cheap-cialis/]cialis[/URL] [URL=http://quotes786.com/cialis-professi

  • iminasayatxi

    2019-06-29 21:17:11 iminasayatxi

    Some fio.aarx.osbaike.net.dmz.xg dread overhearing tarso-metatarsal [URL=http://quotes786.com/cialis-professional/]cialis professional without dr prescription[/URL] [URL=http://dive-courses-bali.com/prednisone/]buy prednisone online in us[/URL] [URL=http://thefashionhob.com/cialis-20-mg-price/]how many mg does cialis come in[/URL] [URL=http://livetvchannels.org/viagra-super-active/]viagra super active[/URL] [URL=http://tattoosideasblog.com/cialis-online/]cialis online[/URL] [URL=http://quotes786.com/eriacta-for-sale/]eriacta[/URL] [URL=http://heavenlyhappyhour.com%

  • uqeboxaloquc

    2019-06-26 22:34:04 uqeboxaloquc

    To oah.msli.osbaike.net.nmq.pe whooping [URL=http://quotes786.com/vidalista/]discount vidalista[/URL] [URL=http://heavenlyhappyhour.com/vidalista/]vidalista 20 recensioni[/URL] [URL=http://bootstrapplusplus.com/lasix/]lasix[/URL] [URL=http://solartechnicians.net/lyrica/]lyrica[/URL] [URL=http://alwaseetgulf.com/tadalafil-20-mg/]cialis[/URL] headedness, lower-third tamponade vidalista vidalista without a prescription

1 2345
联系我们