Anfänger
Go
Go von Grund auf lernen. Beginne mit Paketen, Variablen und Kontrollfluss, dann tiefer einsteigen in Structs, Interfaces, Nebenläufigkeit, Tests, HTTP-Server, Datenbanken, Generics, Profiling und das Ausliefern echter Binaries in die Produktion.
20 Lektionen12.3h praktisch11 Sprachen
Kostenlos lernenGo Kurs20 Lektionen, der Reihe nach
- 125 Min.
Hallo, Go
Package mainImportFunc mainFmt.PrintlnGo run - 225 Min.
Variablen und Typen
Var declarationShort declaration :=IntFloat64StringBool+2 - 330 Min.
Kontrollfluss: if und for
IfElse ifElseFor loopFor as whileInfinite for+2 - 430 Min.
Funktionen
Func keywordParametersReturn valuesMultiple return valuesNamed return valuesBlank identifier - 535 Min.
Slices und Maps
Slice literalAppendLenIndexingRangeMap literal+2 - 640 Min.
Kleines CLI-Abschlussprojekt
Os.ArgsStrconv.AtoiError handling with if err != nilOs.ExitGo buildPutting it together - 735 Min.
Structs und Zeiger
Struct definitionField accessZero values for structsPointer types& and * operatorsPointer receivers vs value receivers+1 - 835 Min.
Methoden und Schnittstellen
Method declarationReceiver typesPointer vs value receiversInterface definitionImplicit interface satisfactionSmall interfaces+1 - 935 Min.
Fehlerbehandlung
Error interfaceFmt.Errorf with %wErrors.IsErrors.AsCustom error typesPanic vs error+1 - 1040 Min.
Goroutines und Channels
The go keywordGoroutine lifetimeUnbuffered channelsBuffered channelsSend and receiveRange over channel+1 - 1145 Min.
Nebenläufigkeitsmuster
Select statementContext.Context for cancellationSync.WaitGroupSync.MutexWorker pool patternFan-out fan-in idea - 1240 Min.
Eine Tour durch die Standardbibliothek
FmtStringsStrconvTimeOsBufio+1 - 1340 Min.
Tests und Benchmarks
Go testTesting.TTable-driven testsT.Run subtestsTesting.B benchmarks_test.go file naming+1 - 1435 Min.
Module und Projektstruktur
Go mod initGo.mod and go.sumImport pathsPackage vs moduleInternal/ folderCmd/ layout+1 - 1545 Min.
HTTP-Server
Net/httpHttp.HandleFuncHttp.ServerJSON responsesRequest routingMiddleware via http.Handler wrapping+1 - 1645 Min.
Datenbanken mit database/sql
Database/sql packageDriver importsSql.Open and sql.DB poolExec vs Query vs QueryRowPrepared statementsScanning rows+1 - 1735 Min.
Generics
Type parameters with [T any]ConstraintsComparableTilde approximation ~intGeneric Map and FilterWhen generics help, when they do not - 1840 Min.
Leistung und Profiling
Go test -benchPprof CPU and heap profilesEscape analysis with -gcflags=-mAvoiding unnecessary allocationsPreallocating slicesSync.Pool intuition - 1940 Min.
Entwurfsmuster in Go
Functional options patternRepository patternDependency injection via interfacesContext propagation through call stacksConstructor functions - 2045 Min.
Deployment und Produktion
CGO_ENABLED=0 static binariesCross-compile with GOOS and GOARCHGraceful shutdown with http.Server and signal.NotifyContextMinimal Dockerfile with scratch or distrolessReading config from environment variables
Lerne Go in deiner Sprache
Jede Lektion, jedes Quiz und jede Tutor-Antwort erscheint in deiner Sprache. Der KI-Tutor antwortet in der Sprache, in der du fragst.
