Thuta Learning
ရှာဖွေရန်
BasicProgrammingbeginner

What is Go?

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

Go သည် Google မှစတင်ဖန်တီးခဲ့သော compiled programming language ဖြစ်ပြီး ရိုးရှင်းမှု၊ performance ကောင်းမှု၊ concurrent programming လုပ်ရလွယ်မှုတို့ကြောင့် လူကြိုက်များပါတယ်။ Go file ကို run လိုက်ရင် machine code အဖြစ် compile လုပ်ပြီး အလုပ်လုပ်တာကြောင့် server-side application တွေမှာ မြန်ပြီး stable ဖြစ်ပါတယ်။

go
package main

import "fmt"

func main() {
    fmt.Println("Hello, Go!")
}

ဒီ code မှာ package main က executable program ဖြစ်ကြောင်းပြောတာပါ။ import "fmt" က screen ထဲ message ထုတ်ဖို့ package ခေါ်တာဖြစ်ပြီး func main() က program စတင်အလုပ်လုပ်တဲ့နေရာပါ။

You should see
Hello, Go!

Info

Go မှာ unused import သို့မဟုတ် unused variable ထားရင် compile error ဖြစ်နိုင်ပါတယ်။ ဒါက စစချင်းနည်းနည်းတင်းကြပ်သလိုခံစားရပေမဲ့ real project မှာ code သန့်အောင် ကူညီပေးပါတယ်။

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • File name ကို hello.go လို .go extension နဲ့ save မလုပ်ရင် Go tool က source file အဖြစ်မသိနိုင်ပါ။
What is Go? | Thuta Learning