Go (език за програмиране)

Go
Парадигмаобектно ориентиран, процедурен
Реализиране през2009 г.
АвторGoogle и
Роб Пайк, Кен Томпсън, Робърт Гриземер
Типизация на даннитестатичен
Повлиян отC, Oberon, Limbo
Повлиява-
Уебсайтgolang.org
Go в Общомедия

Go е език за програмиране, разработен от Google.[1] Първоначалният проект на Go е започнат през септември 2007 г. от Робърт Гриземер, Роб Пайк и Кен Томпсън.[2] Разработката на езика е от 2007 година, но официално е обявен през 2009 година в бета-версия. Въпреки това днес Go се използва в някои приложения на Google, както и в сайта на Go.

Цел

Според създателите на Go целта за създаването му е била породена от появата на многоядрени процесори, паралелни изчисления и ускоряването на работата на компютрите, но не и за разработката на софтуер. Компилира се бързо.

Характеристика

Go е статичен, компилиращ се език с автоматично освобождаване на ресурсите (garbage-collected). Синтаксиса му е близък до този на C с някои изключения. Обектно ориентиран е, но няма класове. Има само един цикъл – for, конструкции if и Switch.

Има вграден мениджър на пакетите (go get), вградени примитиви за паралелна работа, леки (light-weight) процеси наречени goroutines както и channels.

Има компилатори за следните операционни системи: linux, freebsd, darwin(Mac OS X 10.5 or 10.6), 64-bit x86, 32-bit x86 и 32-bit ARM, както и за Windows XP и нататък.

Примерна програма

Програмата Hello, world

package main

import "fmt"

func main() {
  fmt.Printf("Hello, world")
}

Пример (константи, проеменливи, for, switch):

package main

import "fmt"

const (
	HELLO = "Hello"
	INTERVAL = " "
	GOLANG = "Go"
)

var (
	hello string = "Hello"
	world string = "World"
)

func main() {
	// for
	for i := 0 ; i < 5 ; i++ {
		fmt.Println(i)
	}
	fmt.Println(hello + " " + world)
	fmt.Println(HELLO + INTERVAL + GOLANG)
	// switch
	switch {
        case len(HELLO) < len(GOLANG):
                fmt.Println("len(HELLO) < len(GOLANG)")
        case len(HELLO) > len(GOLANG):
                fmt.Println("len(HELLO) > len(GOLANG)")
    }

}

Ключови думи

break        default      func         interface    select
case         defer        go           map          struct
chan         else         goto         package      switch
const        fallthrough  if           range        type
continue     for          import       return       var

Конвенции за писане на код

Създателите на езика полагат усилия за да стандартизират начина на писане на код, идентациите и стила. За целта има създадена страница с най-добрите практики.

Лиценз

Лицензът е BSD.

Източници

  1. Jason Kincaid. Google's Go: A New Programming Language That's Python Meets C++ // TechCrunch. Посетен на 3 март 2011. (на английски)
  2. "Language Design FAQ" // Посетен на 3 март 2011. (на английски)

Външни препратки

Read other articles:

قاسم بن عيسى بن ناجي معلومات شخصية الحياة العملية المهنة عالم  تعديل مصدري - تعديل   هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (أغسطس 2017) أبو الفضل قاسم بن عيسى بن ناجي التنوخي القيرواني:[1] الإِمام الفق...

 

جيمس موراي ميسون (بالإنجليزية: James Murray Mason)‏    معلومات شخصية الميلاد 3 نوفمبر 1798(1798-11-03)جورجتاون (واشنطن العاصمة)  الوفاة 28 أبريل 1871 (72 سنة) [1]  الإسكندرية، فيرجينيا  مواطنة الولايات المتحدة  الأب جون ماسون  مناصب عضو مجلس نواب الولايات المتحدة عن ولاية فرج

 

RheinRhein, Rhin,[1] Rijn, Rein, Ragn, Rain, Rhi(n), RhingSungai Rhein di Basel, SwitzerlandPeta cekungan RhineEtimologiCeltic RēnosLokasiNegaraSwissLiechtensteinAustriaJermanPrancisBelandaCekungan RheinSwissLiechtensteinVorarlberg, Jerman Selatan dan BaratAlsace, PrancisLuksemburgBelgiaNetherlandsVal di Lei, ItalyRegionEropa Tengah dan BaratKota terbesarCologneDüsseldorfRotterdamStrasbourgBaselCiri-ciri fisikHulu sungaiRein Anteriur/Vorderrhein - lokasiTomasee (bahasa Rom...

Ini adalah sebuah nama Islandia. Nama terakhirnya adalah sebuah patronimik, bukan sebuah nama keluarga; tokoh ini biasa disebut dengan nama panggilannya, Thorvald, Thorvaldr, Þorvaldr atau Þorvaldur. Kemungkinan rute perjalanan dari Greenland menuju Vinland Thorvald Eiriksson (bahasa Nordik Kuno: Þōrvaldr Eirikssonr; bahasa Islandia: Þorvaldur Eiríksson) adalah putra dari Erik si Merah dan saudara dariLeif Erikson. Satu-satunya bahan sumber Abad Pertengahan yang tersedia yang me...

 

Герб Олешківського району ДеталіНосій Олешківський районЗатверджений 17 грудня 2004 Герб Олешківського району — офіційний символ Олешківського району, затверджений рішенням сесії районної ради. Опис Щит перетягнутий зеленим і золотим. На щиті срібний сувій; на верхньому

 

Dutch or Flemish mine entrepreneur and mineral prospector This article is about the 16th-century miner. For the Flemish painter, see Cornelis de Vos. The Earl of Bothwell, who signed a contract for Cornelius de Vos, painted by an unknown artist in 1566 Cornelius de Vos or de Vois or Devosse (fl. 1565-1585), was a Dutch or Flemish mine entrepreneur and mineral prospector working in England and Scotland. He was said to have been a picture-maker or portrait artist. De Vos is known for gold minin...

Japanese Buddhist studies scholar (1866–1945) Takakusu JunjiroBorn(1866-06-29)June 29, 1866Yahata, Hiroshima Prefecture, JapanDiedJune 28, 1945(1945-06-28) (aged 78)Other namesUmetarō SawaiOccupationBuddhist scholar Takakusu Junjirō (高楠 順次郎, June 29, 1866 – June 28, 1945), who often published as J. Takakusu, was a Japanese academic, an advocate for expanding higher education opportunities, and an internationally known Buddhist scholar.[1] He was an active Esp...

 

10-й Одеський міжнародний кінофестиваль Офіційний постер 10-го ОМКФФільм відкриття «Прекрасна епоха»Фільм закриття «Бог існує, її ім'я — Петрунія»Місце проведення Одеса, УкраїнаНагорода Золотий Дюк(«А потім ми танцювали» та «Додому»)Заснування 2010Ведучий Олег Панюта та ...

 

SMK Negeri 1 CilegonInformasiDidirikan1997JenisNegeriAkreditasiANomor Statistik Sekolah301286004002Nomor Pokok Sekolah Nasional20606250Kepala SekolahWidodo, M.Pd NIP:19750422 200312 1 007Jumlah kelasKelas TerbangJurusan atau peminatan • TOI  • TP  • DGM  • TKR  • MEKA • TEI • SIJA • RPL • TFLM Rentang kelasX , XI, XII, XIIIKurikulumKurikulum MerdekaJumlah siswaPeserta Didik (2022/2023)Kelas 1 =Kelas 2 =Kelas 3 =Kela...

For 1957 Tamil film, see Soubhagyavathi. 1939 Indian filmSowbagyavathiDirected byPrem ChetnaScreenplay byG. GovindarajuluStory byAayiram Mugam RamkumarStarringAayiram Mugam RamkumarG. GovindarajuluS. P. L. DhanalakshmiP. R. MangalamCinematographyJ. S. PatelEdited byD. GovindanMusic byG. GovindarajuluProductioncompanyLakshmi Film CompanyDistributed byKovai Premier CinetoneRelease date 26 August 1939 (1939-08-26) (India) [1]Running time188 minutesCountryIndiaLanguageT...

 

Malaysian footballer This biography of a living person needs additional citations for verification. Please help by adding reliable sources. Contentious material about living persons that is unsourced or poorly sourced must be removed immediately from the article and its talk page, especially if potentially libelous.Find sources: Muhammad Al-Hafiz – news · newspapers · books · scholar · JSTOR (November 2010) (Learn how and when to remove this template m...

 

British scholar This biography of a living person relies too much on references to primary sources. Please help by adding secondary or tertiary sources. Contentious material about living persons that is unsourced or poorly sourced must be removed immediately, especially if potentially libelous or harmful.Find sources: Adel Iskandar – news · newspapers · books · scholar · JSTOR (June 2011) (Learn how and when to remove this template message) Adel Iskand...

Chinese serial killer Zhang YongmingBorn1956ChinaDiedJanuary 10, 2013 (aged 56–57)Yunnan, ChinaCause of deathExecutionOther namesThe Cannibal KillerCannibal MonsterConviction(s)Intentional homicideCannibalismCriminal penaltyDeathDetailsVictims11Span of crimesMarch 2008 – April 2012CountryChinaState(s)YunnanDate apprehendedMay 9, 2012 In this Chinese name, the family name is Zhang. Zhang Yongming (Chinese: 张永明; 1956 – January 10, 2013) was a Chi...

 

Fish market in Seattle, Washington, U.S. 47°36′33.93″N 122°20′30.12″W / 47.6094250°N 122.3417000°W / 47.6094250; -122.3417000 Pike Place Fish MarketTypePrivateIndustrySeafoodFounded1930Headquarters86 Pike PlaceSeattle, Washington, U.S.OwnersJaison Scott, Ryan Reese, Samuel Samson, Anders MillerWebsitehttp://pikeplacefish.com Pike Place Fish Market Pike Place Fish Market is an open-air fish market at Pike Place Market in Seattle, Washington, United States, l...

 

Стіві Ніксангл. Stevie Nicks Основна інформаціяПовне ім'я англ. Stephanie Lynn NicksДата народження 26 травня 1948(1948-05-26)[1][2][3] (75 років)Місце народження Фінікс, США[1]Роки активності 1969 — тепер. часГромадянство СШАПрофесії співачка, авторка пісень, авторка-виконавиця,&...

Guru of Hindu deity Krishna SandipaniKrishna returns Sandipani's son back to him.AffiliationRishiTextsPuranasRegionAvanti Sandipani (Sanskrit: सान्दीपनि, romanized: Sāndīpani), sometimes rendered Sāndīpana, is the guru of Krishna and Balarama in Hinduism. He is regarded to have educated them regarding all the Vedas, the art of drawing, astronomy, gandharva veda, medicine, training elephants and horses, and archery.[1] Legend The Bhagavata Purana relates the ...

 

Multi-Purpose Arena in Greeley, Colorado Bank of Colorado Arena at Butler-Hancock Athletic CenterFormer namesButler-Hancock HallButler–Hancock Sports PavilionLocation270 Alles DriveGreeley, CO 80639Coordinates40°24′08″N 104°42′11″W / 40.4022171°N 104.7030436°W / 40.4022171; -104.7030436OwnerUniversity of Northern ColoradoOperatorUniversity of Northern ColoradoCapacity2,992 (2011-present)2,941 (2006-2011)4,500 (1975-2006)SurfaceHardwoodConstructionBroke gr...

 

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Roland Rat – news · newspapers · books · scholar · JSTOR (February 2008) (Learn how and when to remove this template message) Fictional character Roland RatRoland Rat on TV-am, where he first rose to fame.First appearance1983 TV-amCreated byDavid ClaridgeIn-uni...

People born or native in Hunan, China Hunanese people 湖湘民系/湘人/湘語人 Shiōn'nỳ ninTwo Hunannese men counting brass coins in Changde, circa 1900-1919.Total population38,149,000[1]Regions with significant populations Mainland ChinaHunan Northeastern Guangxi parts of Guizhou Republic of China on TaiwanAs a small part of Mainlander population of Taiwan islandLanguagesXiang ChineseMandarin ChineseReligionMahayana Buddhism, Taoism, Confucianism, and Chinese folk religion Th...

 

الصفحه دى يتيمه, حاول تضيفلها مقالات متعلقه لينكات فى صفحات تانيه متعلقه بيها. راهيم تايلور پاركيس معلومات شخصيه الميلاد 21 ابريل 1998 (26 سنة)[1][2]  ميسيسوجا  مركز اللعب مهاجم (كوره قدم)  الجنسيه كندا  المدرسه الام جامعة فرجينيا  الحياة العمليه المهنه لعيب ك...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!