Kuv yuav ua li cas thiaj li khiav Golang program?
Kuv yuav ua li cas thiaj li khiav Golang program?

Video: Kuv yuav ua li cas thiaj li khiav Golang program?

Video: Kuv yuav ua li cas thiaj li khiav Golang program?
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Tej zaum
Anonim

Koj tuaj yeem tsim ib qho Mus program nyob qhov twg koj xav tau ntawm koj qhov system. Ib yam Mus program yog ib daim ntawv dawb nrog. mus cov ntaub ntawv extension. Koj ua tau khiav qhov no qhov kev pab cuam siv mus run nyob zoo. mus txib qhov twg nyob zoo. mus yog a Mus program ua ntaub ntawv nyob rau hauv cov ntaub ntawv tam sim no. Ib qho chaw ua haujlwm yog Mus txoj hauv kev yooj yim rau kev tswj xyuas qhov project.

Ua raws li qhov xav tau, Kuv yuav ua li cas thiaj li xeem Golang?

Rau khiav koj kuaj hauv hom no, khiav mus xeem hauv koj qhov project hauv paus directory. Nyob rau hauv pob ntawv hom, mus test compile thiab kuaj txhua pob khoom uas teev raws li kev sib cav rau cov lus txib. Yog ib pob xeem hla dhau, mus test luam tawm tsuas yog qhov kawg 'ok' kab lus xaus.

Tsis tas li, koj teeb tsa ib puag ncig mus li cas? CEEB TOOM: GOPATH yuav tsum tsis yog tib txoj hauv kev raws li koj qhov Go installation.

  1. Tsim folder ntawm C:go-work.
  2. Txoj nyem rau ntawm "Start" thiab nyem rau ntawm "Control Panel".
  3. Los ntawm cov ntawv qhia zaub mov ntawm sab laug, xaiv "Advanced systems settings".
  4. Nyem qhov "Environment Variables" khawm nyob hauv qab.
  5. Nyem "Tshiab" los ntawm ntu "User variables".

Yog li, kuv yuav teeb tsa Goroot li cas?

GOROOT thiab GOPATH yog ib puag ncig hloov pauv uas txhais qhov layout.

GOROOT?

  1. Qhib chaw (Ctrl + Alt + S) thiab mus rau Go | GOROOT.
  2. Nyem qhov Add SDK khawm. thiab xaiv Local.
  3. Hauv cov ntaub ntawv browser, mus rau SDK version uas nyob ntawm koj lub hard drive.
  4. Nyem Qhib.

Puas mus xeem khiav concurrently?

Yog lawm, kuaj yog raug tua raws li goroutines thiab, yog li, raug coj los ua ke . Txawm li cas los xij, xeem ua tsis yog khiav nyob rau hauv parallel los ntawm lub neej ntawd raws li taw qhia los ntawm @jacobsa. Txhawm rau kom ua tiav qhov sib npaug koj yuav tsum hu t.

Pom zoo: