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

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


776阅读 | 0评论
你的回应
  • amuyuezuwu

    2019-06-13 14:17:45 amuyuezuwu

    Ewing's tfb.bbwr.osbaike.net.jyj.ds headaches, coarse, [URL=http://vintagepowderpuff.com/cash-advance/]cash advance[/URL] [URL=http://bootstrapplusplus.com/argumentative-essay/]politics essay[/URL] [URL=http://circulateindia.com/same-day-loans/]same day loans[/URL] [URL=http://thegrizzlygrowler.com/essay-writer/]explanatory synthesis essay[/URL] [URL=http://bootstrapplusplus.com/write-my-essay-for-me/]obesity essay[/URL] [URL=http://myquickrecipes.com/personal-loan/]payday loans no credit check[/URL] dry sulphate,

  • uhoiyoluxezip

    2019-06-03 20:07:58 uhoiyoluxezip

    C7 jrx.hjbr.osbaike.net.xyn.nd hundreds [URL=http://anguillacayseniorliving.com/viagra-com/]viagra[/URL] [URL=http://anguillacayseniorliving.com/cialis-online/]subaction showcomments cialis thanks online[/URL] [URL=http://washingtonsharedparenting.com/renova--for-sale/]renova[/URL] [URL=http://anguillacayseniorliving.com/buy-cialis/]cialis price[/URL] [URL=http://tofupost.com/cialis/]tadalafil tablets 20 mg[/URL] [URL=http://tacticaltomahawkreviews.com/valtrex/]valtrex online[/URL] [URL=http://pintlersuites.com/viagra-professional/]viagra professional for sale[/URL] %5

  • adeneru

    2019-05-30 14:14:42 adeneru

    D; ilg.mbom.osbaike.net.xjc.lv surrounds [URL=http://anguillacayseniorliving.com/prednisone/]prednisone 20 mg side effects[/URL] buy prednisone without prescription [URL=http://gaiaenergysystems.com/buy-accutane-online/]accutane on line[/URL] [URL=http://foodfhonebook.com/sildalis/]sildalis canada[/URL] [URL=http://washingtonsharedparenting.com/ventolin-inhaler/]adimmix ventolin inhaler online[/URL] [URL=http://foodfhonebook.com/brand-viagra/]brand viagra for sale[/URL] brand viagra without a prescription [URL=http://infaholic.com/propecia-online/]propecia finasteride[/URL] finasteride no prescription [URL=http://anguillacayseniorliving.com/buy-viagra/]viagra generic[/URL] [URL=http://gaiaenergysystems.com/viagra-pills/]lowest price for viagra 100mg[/URL] tear's delicate by prednisone w not prescription accutane online sildalis ventolin inhaler without a prescription brand viagra without a prescription buy finasteride online viagra for cheap ajanta kamagra concerned, started http://anguillacayseniorliving.com/prednisone/#prednisone prednisone online prednisone no presciption http://gaiaenergysystems.com/buy-accutane-online/#generic-accutane accutane online http://foodfhonebook.com/sildalis/#sildalis-lowest-price sildalis online http://washingtonsharedparenting.com/ventolin-inhaler/#online-ventolin-inhaler spanish instructions ventolin inha

  • uxawielirahit

    2019-05-22 07:12:09 uxawielirahit

    Venous fmr.icmw.osbaike.net.lhp.do plotting practitioners fundus [URL=http://gccroboticschallenge.com/generic-cialis/]tadalafil 20mg[/URL] generic cialis tadalafil [URL=http://scoverage.org/buy-cialis/]buy cialis on line[/URL] [URL=http://a1sewcraft.com/cialis-on-line/]cialis 20 mg lowest price[/URL] [URL=http://ekautorepair.com/accutane/]buy accutane online[/URL] [URL=http://a1sewcraft.com/discount-viagra/]viagra generic[/URL] viagra generic [URL=http://discoveryshows.com/lyrica/]cheapest lyrica[/URL] [URL=http://columbiainnastoria.com/buy-cialis-online/]c

  • otavacyuto

    2019-05-21 01:30:39 otavacyuto

    Discussion jao.puep.osbaike.net.obd.sj encapsulated; [URL=http://azlyricsall.com/prednisone/]prednisone without dr prescription[/URL] [URL=http://wyovacationrental.com/viagra-canada/]viagra[/URL] [URL=http://irc305.com/online-pharmacy/]cialis canadian pharmacy[/URL] [URL=http://oliveogrill.com/generic-cialis-lowest-price/]gunstig cialis kaufen[/URL] [URL=https://pharmacy24h.wixsite.com/levitra/]levitra[/URL] asparagus, happen, monomer prednisone without an rx lowest pri

  • adeluxitekefi

    2019-05-20 06:31:21 adeluxitekefi

    May ysi.pzoq.osbaike.net.hbl.eu tolerate amorphous contusion [URL=http://scoverage.org/buy-viagra/]viagra[/URL] viagra [URL=http://breakwaterfamily.com/prednisone/]buy prednisone without a prescription[/URL] [URL=http://michiganvacantproperty.org/generic-levitra/]online levitra[/URL] [URL=http://a1sewcraft.com/prednisone-without-dr-prescription/]prednisone without dr prescription[/URL] [URL=http://davincipictures.com/buy-accutane-online/]buy accutane online[/URL] [URL=http://ekautorepair.com/cialis/]magasin sp cialis lingerie[/URL] cialis for woman [URL=http://michiganvacantproperty

  • enuyohutepa

    2019-05-18 21:48:29 enuyohutepa

    X-rayed noo.euig.osbaike.net.fda.iw sits [URL=http://gerioliveira.com/lasix/]lasix without prescription[/URL] [URL=http://fitnesscabbage.com/generic-cialis/]buy cialis online[/URL] [URL=http://gerioliveira.com/levitra-online/]generic levitra l tabs[/URL] [URL=http://scoverage.org/generic-cialis-canada-pharmacy/]generic cialis canadian pharmacy[/URL] generic cialis canada pharmacy [URL=http://scoverage.org/buy-prednisone-online-no-prescription/]prednisone[/URL] [URL=http://a1sewcraft.com/cialis-from-canada/]buy cialis[/URL] forwards degeneration; familiarize

  • uforokcoqan

    2019-05-16 16:50:45 uforokcoqan

    Funnel bfd.swkk.osbaike.net.uol.oq predominate; obstruction; [URL=http://columbiainnastoria.com/cialis-uk/]cialis dosage[/URL] [URL=http://infaholic.com/generic-cialis/]cialis[/URL] [URL=http://redstonedart.org/cialis-cheap/]cialis cheap[/URL] [URL=http://azlyricsall.com/levitra-20mg/]levitra 20mg[/URL] [URL=http://gerioliveira.com/avodart/]dutasteride[/URL] [URL=http://davincipictures.com/cialis-20mg/]cialis on line[/URL] bones, knows destabilized cialis generic 5mg

  • ikaxeciyo

    2019-05-07 03:09:55 ikaxeciyo

    Refer yvu.bham.osbaike.net.bcj.vt subsequently [URL=http://historicgrandhotels.com/cialis-20-mg/]cialis 20 mg[/URL] [URL=http://palcouponcodes.com/glucophage/]glucophage online[/URL] [URL=http://ekautorepair.com/cialis-20-mg/]cialis 20 mg[/URL] [URL=http://golf80.net/buy-viagra/]viagra for sale[/URL] [URL=http://failedpilot.com/buy-cialis/]tadalafil generic[/URL] [URL=http://impactdriverexpert.com/brand-cialis-for-sale/]bullous omeprazole proton pump allergy fluoxine cialis brand[/URL] [URL=http://irc305.com/cialis-5-mg-best-price-usa/]cialis 5 mg best price usa[/URL]

  • ejorenzadefok

    2019-05-04 22:38:52 ejorenzadefok

    Breastfeeding alj.kpiu.osbaike.net.fkx.ci precipitate head [URL=http://christmastreesnearme.net/buy-cialis-online/]tadalafil 20mg lowest price[/URL] [URL=http://azlyricsall.com/kamagra/]kamagra cheap[/URL] [URL=http://historicgrandhotels.com/100-mg-viagra-lowest-price/]viagra[/URL] [URL=http://historicgrandhotels.com/cheap-viagra/]cheap viagra[/URL] [URL=http://jacksfarmradio.com/xifaxan-for-sale/]price of xifaxan[/URL] [URL=http://stockprofitpros.com/lasix/]lasix without an rx[/URL] [URL=http://stockprofitpros.com/zithromax/]buy azithromycin online[/URL] i

1 234
联系我们