Cov txheej txheem:

Kuv yuav tsim Go app li cas?
Kuv yuav tsim Go app li cas?

Video: Kuv yuav tsim Go app li cas?

Video: Kuv yuav tsim Go app li cas?
Video: Yuav Ua Li Cas Thiaj Pab Rau Koj Hais Lus English Tau Zoo (by Mai ) 6/2/20 2024, Kaum ib hlis
Anonim

Txhawm rau teeb tsa koj cov ntaub ntawv main.go:

  1. Hauv koj mus - app / folder, tsim ib main. mus ntaub ntawv.
  2. Ntxiv cov pob ntawv tseem ceeb los kho koj cov cai raws li kev ua haujlwm tau zoo: pob lub ntsiab.
  3. Ntshuam cov pob khoom hauv qab no: appengine/go11x/helloworld/helloworld. mus .
  4. Txhais koj tus HTTP handler:
  5. Sau npe koj tus HTTP handler:

Xav txog qhov no, ua li cas koj ua ib qho app mus?

  1. Kauj Ruam 1: Nruab lub pob. Ua raws li qhov txuas mus rau lub vev xaib nom golang xaiv koj lub platform thiab cov lus qhia cuam tshuam txog kev teeb tsa.
  2. Kauj Ruam 2: Teeb peb cov qauv sau npe. Thaum nruab, cia peb hloov cov npe rau peb GOPATH.
  3. Kauj Ruam 2: Tsim Cov Pem Hauv Ntej Kawg.
  4. Kauj ruam 3: Mus rau Server Logic!
  5. Kauj ruam 4: Khiav peb daim ntawv thov.

Qhov thib ob, kuv yuav nruab mus li cas? Nruab Go

  1. Txheeb xyuas cov ntaub ntawv.tar siv sha256sum: sha256sum go1.12.9.linux-amd64.tar.gz.
  2. Extract lub tarball: tar -xvf go1.12.9.linux-amd64.tar.gz.
  3. Kho cov kev tso cai thiab txav mus rau cov npe mus rau /usr/local: sudo chown -R hauv paus: hauv paus./go sudo mv mus /usr/local.

Ua raws li qhov no, daim ntawv thov Go yog dab tsi?

Mus yog ib hom lus qhib qhov programming uas ua rau nws yooj yim los tsim cov software yooj yim, txhim khu kev qha, thiab muaj txiaj ntsig zoo. Download tau Mus . Binary distributions muaj rau. Linux, macOS, Windows, thiab lwm yam.

Puas yog Golang zoo dua Python?

Nyob rau hauv tag nrho, Golang kev txhim kho lub vev xaib tau ua pov thawj tias sai dua siv Python rau tib hom haujlwm hauv ntau qhov kev siv. Thaum kawg, Golang yog tsim rau cov neeg uas xav kom cov hauj lwm ua kom tiav thiab ceev ceev yam tsis tas yuav tsum tau mus nyob rau hauv lub subtleties ntawm lub programming lus.

Pom zoo: