Aller au contenu principal
ProduitsOutils de bureauTASTECADConsultation de plansTASTEFILESGestion de fichiersTASTEFTPTransfert de fichiersTASTESSHEspace de travail à distanceTASTEZIPCompression et extractionTASTEWINMGestion de fichiersOutils pour développeursTASTECODEEnvironnement de développement intégré pour RustTASTESTUDIOEnvironnement intégré de développement et de testTASTEETLIntégration de données (ETL)ServeursTASTEREMOTEServeur de bureau à distanceTASTEGEOServeur géospatialTASTEMAILEspace de travail e-mailInvestissementTASTESTOCKApplication de bureau de trading automatique d'actionsCommencerTéléchargementsDocumentationAcheterTous les produits
Marketplace
Actualités
TechActualitésL’actu dev du jourDocs développeursLangages de programmationRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFrameworks front-end webNext.jsReactVue.js · NuxtSvelteKitAngularFrameworks serveurSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFrameworks d'applications et de bureauTauriFlutterReact NativeElectronAlgorithmesBases des algorithmesAlgorithmes essentielsAlgorithmes avancésAlgorithmes pratiques
CommunautéProjetsJournaux de développementPromptsProblèmes d’outils d’IAVitrineGuide de la communauté
CollaborerTransfert techniqueRéalisation de site webRéalisation d'application de bureauChaîne de publication et de paiementPartenaire commercialContact
ServicesBureau à distancePaquets d'installation sur mesure
TASTEDEV
Produits

Outils de bureau

TASTECADDes plans complexes, ouverts en toute légèretéTASTEFILESSeulement les fichiers utiles, au plus viteTASTEFTPLe chemin le plus net pour vos fichiersTASTESSHEntre vos serveurs et vous, un lien plus solideTASTEZIPCompresser plus vite, extraire en toute sécuritéTASTEWINMUn gestionnaire de fichiers à deux volets, pensé pour le clavier

Outils pour développeurs

TASTECODEModifier, compiler, déboguer et tester vos apps Rust dans une seule fenêtreTASTESTUDIODe l’édition aux tests à distance et aux corrections IA approuvéesTASTEETLDéplacer les données, les valeurs sous les yeux

Serveurs

TASTEREMOTEUn bureau à distance hébergé sur votre propre serveurTASTEGEOUn serveur géospatial compatible GeoServer, reconstruit en RustTASTEMAILReprenez la maîtrise de vos e-mails

Investissement

TASTESTOCKDu trading automatique d'actions selon vos règles : quand, et quoi

Commencer

TéléchargementsDernières versions de chaque produitDocsUtiliser chaque produitAcheterAbonnements et licences perpétuellesTous les produitsTous les produits en un coup d’œil
Tous les produits
MarketplaceActualités
Tech

Actualités

L’actu dev du jourAnnonces officielles : langages, frameworks, GitHub et IADocs développeursGuides des langages, frameworks et algorithmes

Langages de programmation

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Frameworks front-end webNext.jsReactVue.js · NuxtSvelteKitAngular
Frameworks serveurSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Frameworks d'applications et de bureauTauriFlutterReact NativeElectron

Algorithmes

Bases des algorithmesAnalyse de complexité · Tri · Recherche · Structures de données de base · Arbres et tasAlgorithmes essentielsParcours de graphe · Plus courts chemins et arbres couvrants · Programmation dynamique · Algorithmes gloutons · Diviser pour régner · Backtracking (retour sur trace)Algorithmes avancésAlgorithmes sur les chaînes · Mathématiques et théorie des nombres · Manipulation de bits · Arbres de segments · Union-FindAlgorithmes pratiquesStratégie pour les entretiens de codage · Cache LRU · Limitation de débit · Hachage cohérent
Toute la documentation de développement
Communauté
ProjetsDécouvrir les créateurs et leurs travauxJournaux de développementDécisions et enseignementsPromptsInstructions réutilisablesProblèmes d’outils d’IAProblèmes et contournements de Claude, Codex, GeminiVitrineRéalisations terminéesGuide de la communautéConstruire en toute transparence
Collaborer
Transfert techniqueApplications natives en Rust et eguiRéalisation de site web10 langues, comptes, documentation et téléchargementsRéalisation d'application de bureauRust et egui, sans WebViewChaîne de publication et de paiementSignature, MSI, deb, rpm, AppImage, empreintesPartenaire commercialRecommandez-nous, touchez 30 %ContactDéveloppement, partenariats, investissement
Services
Bureau à distanceAccédez à votre ordinateur depuis le navigateurPaquets d'installation sur mesureSeulement l'utile, réglages préchargés
Acheter
FR
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Se connecter
Se connecter
TASTEDEV

Des petits outils à un meilleur développement.

support@tastedev.netSoutenir TASTEDEV
ProduitsGamme de produitsAcheterDocsTéléchargementsMarketplaceAssistance
CommunautéProjetsJournaux de développementPromptsProblèmes d’outils d’IAVitrine
RèglesÀ proposPolitique de confidentialitéConditions d'utilisationConditions d’abonnementRemboursementRègles de la communauté
CompteSe connecterS'inscrire
Visiteurs
Aujourd’hui
Hier
Vues au total
Société
GXSOFT
Représentant
CHOI YOUNG GU
Numéro d’enregistrement
853-44-00368
Adresse
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Téléphone
+82-10-4404-1523
E-mail
whitecalvin@tastedev.net
Responsable de la confidentialité
CHOI YOUNG GU

© 2026 TASTEDEVLes informations produit s'appuient sur des sources de développement vérifiées.Publié · en amélioration

Documentation Go
Go
Getting Started with GoSyntax BasicsTypes and DataModules and PackagesErrors and TestingKey Concepts: Concurrency
Discussions

Guide Go · 1/6

Getting Started with Go

Ce chapitre n'est disponible qu'en anglais pour le moment.

Go was designed to be boring in the best sense: a small language, a fast compiler, and concurrency built in from day one. This chapter walks you from a fresh machine to a compiled binary. You will install the toolchain, create a module, run and build a program, and wire up your editor so it catches mistakes as you type.

Installing the toolchain

Grab an installer for your platform from go.dev/dl. On Windows and macOS, run the installer and you are done. On Linux, the usual approach is to unpack the archive into /usr/local and add /usr/local/go/bin to your PATH. Package managers such as Homebrew or winget work too, though Linux distribution repositories sometimes lag well behind the current release, so check what you actually got.

# Linux: replace any previous install and put go on the PATH
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go*.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin

# Confirm everything is wired up
go version
go env GOPATH GOROOT

If go version prints a version string, the install worked. go env shows the settings the toolchain uses. GOROOT is where Go itself lives. GOPATH holds the module download cache and, under GOPATH/bin, any binaries you install with go install. Adding that bin directory to your PATH saves a lot of typing later.

Your first module

Go organizes code into modules: a directory containing a go.mod file, plus every package beneath it. Start each new project with go mod init and a module path. By convention, the path is where the code will eventually live, such as a repository URL, but any unique name works while you experiment.

mkdir hello && cd hello
go mod init example.com/hello

Now add main.go. Anything you want to compile into an executable must be in package main and must define a main function, which is where execution begins.

package main

import "fmt"

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

Running and building

go run compiles and runs in one step, dropping the binary in a temporary directory. It is ideal for quick iterations. go build leaves a real executable behind in the current directory.

go run .             # compile the current package and run it
go build             # produces ./hello (hello.exe on Windows)
go build -o bin/app  # choose the output path
./hello

# Cross-compile for another platform: just set two variables
GOOS=linux GOARCH=arm64 go build -o hello-linux-arm64
Des questions sur ce chapitre ?
Chapitre suivantSyntax Basics

By default a Go binary is a single self-contained file, which makes deployment refreshingly simple: copy it to the server and run it. Cross-compiling needs no extra toolchain; GOOS and GOARCH are all it takes.

The go command at a glance

CommandWhat it does
go run .Compile and run immediately
go buildBuild an executable or check that a package compiles
go test ./...Run tests in every package
go fmt ./...Rewrite code into the standard format
go vet ./...Static checks for common bugs
go mod tidySync go.mod with what the code imports
go doc fmt.PrintlnRead documentation in the terminal

The ./... pattern means "this directory and everything below it." Because gofmt defines the one true layout, Go teams simply do not argue about brace placement or indentation. Go source uses tabs for indentation, and the formatter takes care of the rest.

Laying out a project

A tiny program needs nothing more than go.mod and main.go. As a codebase grows, a layout like the one below is common. None of it is mandatory, with one exception: the toolchain gives the internal directory special meaning.

hello/
  go.mod            # module path and dependency requirements
  go.sum            # checksums for those dependencies
  main.go           # package main
  cmd/
    server/main.go  # one directory per extra binary
  internal/
    store/store.go  # importable only from inside this module
  greet/
    greet.go        # a package other modules may import

Every directory is exactly one package, and all .go files in it must declare the same package name. Packages under internal can only be imported by code rooted at the parent of that internal directory, which makes it the natural home for implementation details you do not want to support publicly.

Editor setup with gopls

gopls (pronounced "go please") is the official language server maintained by the Go team. It powers completion, go-to-definition, rename, diagnostics, and automatic import management. In VS Code, install the Go extension and accept its prompt to install the tools. GoLand ships its own analysis engine. Neovim, Emacs, Helix, and other LSP-capable editors can all talk to gopls directly.

go install golang.org/x/tools/gopls@latest
gopls version

Configure your editor to run gofmt or goimports on save. This matters more in Go than elsewhere: unused imports and unused local variables are compile errors, not warnings, so having imports added and removed automatically keeps you in flow.

Summary

  • Install from go.dev/dl and verify with go version.
  • Start a project with go mod init <module path>; executables live in package main and start at main.
  • Use go run for quick feedback, go build for binaries, and GOOS/GOARCH for cross-compiling.
  • One directory equals one package, and internal keeps code private to your module.
  • Hook gopls into your editor and format on save.

0 commentaire

Meilleurs commentairesPlus récents d'abord

Se connecter · Connectez-vous pour laisser un commentaire.