{"id":20345447,"url":"https://github.com/naqvijafar91/go-workshops","last_synced_at":"2025-04-12T00:41:06.845Z","repository":{"id":78867469,"uuid":"232302511","full_name":"naqvijafar91/go-workshops","owner":"naqvijafar91","description":"Golang Workshop Repository","archived":false,"fork":false,"pushed_at":"2020-02-06T09:13:08.000Z","size":6459,"stargazers_count":10,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T20:22:03.578Z","etag":null,"topics":["go","golang","workshop","workshop-material"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naqvijafar91.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-07T10:39:20.000Z","updated_at":"2025-01-29T04:36:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"99c1dd81-3ca2-4c8a-8ee0-bf082490b6f2","html_url":"https://github.com/naqvijafar91/go-workshops","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvijafar91%2Fgo-workshops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvijafar91%2Fgo-workshops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvijafar91%2Fgo-workshops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvijafar91%2Fgo-workshops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naqvijafar91","download_url":"https://codeload.github.com/naqvijafar91/go-workshops/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501960,"owners_count":21114681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","workshop","workshop-material"],"created_at":"2024-11-14T22:08:32.793Z","updated_at":"2025-04-12T00:41:06.811Z","avatar_url":"https://github.com/naqvijafar91.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang Workshop\n\nThis repository contains files needed for managing Go language workshop - it's some kind of quite complete walk-through of Go language. Feel free to look at the code, there are many comments which could be useful for beginners and semi-intermediate Go developers.\n\n## What will be covered?\n1. Introduction\n2. [Variables and Constants](docs/01-variables-types-constants.md)\n3. [Functions](docs/02-functions-and-packages.md)\n4. [Packages](docs/02-functions-and-packages.md)\n5. [Conditional Statements](docs/03-conditional-and-loops.md)\n6. [Loops](docs/03-conditional-and-loops.md)\n7. [Arrays](docs/04-arrays-slice-variadic-fn.md)\n8. [Slice](docs/04-arrays-slice-variadic-fn.md)\n9. [Variadic Functions](docs/04-arrays-slice-variadic-fn.md)\n10. [Maps](docs/07-maps-and-strings.md)\n11. [Strings](docs/07-maps-and-strings.md)\n12. [Pointers](docs/08-pointers.md)\n13. [Structs](docs/09-structs-and-interface.md)\n14. [Interface](docs/09-structs-and-interface.md)\n15. [Goroutines, channels](docs/10-concurrency.md)\n16. [sync.WaitGroup and sync.Mutex](docs/10-concurrency.md)\n17. [Unit Testing](docs/12-testing.md)\n18. [Object Oriented Programming in Go](docs/11-object-oriented-programming.md)\n19. [WATS](999-WATS/)\n\n\n## About Go\n\nWho designed Go language?\n\n- Rob Pike (Unix, UTF-8)\n\n- Ken Thompson (Unix author, UTF-8, B lang)\n\n- Robert Griesemer (V8, Java Hotspot (Oracle Java), GFS)\n\nbut those above are only ignitors of whole contributions: https://golang.org/AUTHORS\n\nWhy `go` was developed by Google? They have a lot of problems in C/Python/Java codebases:\n\n- speed up development\n\n- speed up compiling\n\n- multicore systems\n\nsources:\n\n- https://golang.org/doc/faq#What_is_the_purpose_of_the_project\n\n- https://talks.golang.org/2012/splash.article\n\n## Go language characteristics\n\n- statically compiled (one fat binary with all dependencies)\n\n- Garbage Collected\n\n- Strong types\n\n- Functions as first class citizens\n\n- Object Oriented (but without inheritance and classes)\n\n## Why it's worth of your time?\n\n- easy deployment (no dependencies, single binary statically linked)\n\n- no more code style wars - `gofmt`\n\n- integrated package downloader `go get`\n\n- integrated code validation `go vet` and `golint` (github.com/golang/lint)\n\n- nice playground (https://play.golang.org/)\n\n- `gocode` intellisense server - you don't need fat IDE to write go code, you can use now editor which you love (Sublime, Atom, Vim, Emacs, VSCode)\n\n- very fast compilation - if you're going from JAVA world you'll be really surprised\n\n- quite complete standard library - template/html, performant www servers, json, xml, streams, io, buffers, first class citizen concurrency\n\n- easy to use cross-compilation (x64, ARM, 386, Mac, Windows)\n\n- easy start, bunch of editors, all things simply work\n\n- http2 in core\n\n- testing included\n\n- benchmarking of code included\n\n- very low entry barrier\n\n- hype, one of fastest growing language, many new projects are in Go recently\n\n- concurrency\n\n- great documentation generator\n\n- and many many more ...\n\n## Workshop prerequisites\n\nYou can install `golang` and `docker` using your preferred way i.e. your OS package manager (brew, pacman, apt, snap or other) or you can simply follow installation instruction on go and docker sites.\n\n### Golang installation\n\nFor recent installation instructions please refer to [Golang installation guide](https://golang.org/doc/install)\n\nYou'll need `git` to be installed\n\n### Docker install\n\n\u003e Docker is the company driving the container movement and the only container platform provider to address every application across the hybrid cloud. Today’s businesses are under pressure to digitally transform but are constrained by existing applications and infrastructure while rationalizing an increasingly diverse portfolio of clouds, datacenters and application architectures. Docker enables true independence between applications and infrastructure and developers and IT ops to unlock their potential and creates a model for better collaboration and innovation.\n\nFor recent docker installation please follow [Docker installation guide](https://docs.docker.com/install/) for your OS.\n\nDocker is needed for some parts of workshops for running databases or other needed dependencies. Also will be needed to complete homework.\n\n### Docker Compose Installation\n\n\u003e Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.\n\nTo install docker compose please follow [Docker compose installation guide](https://docs.docker.com/compose/install/)\n\n## Init workshops to play on your machine with code\n\n\"go get\" command is the standard way of downloading and installing packages and related dependencies. \"go get\" command clones a git repo to your local machine at *$GOPATH/src/github.com/*\n\n```\ngo get go-workshops\n\ncd \\$GOPATH/src/go-workshops\n```\n\n## Go Tools\n\n### Included\n\n- go test - included testing framework\n\n- go fmt - code formater - only one valid coding standard - [fmt library website](https://golang.org/pkg/fmt/)\n\n- go vet - code validator and fixer - [vet library website](https://golang.org/cmd/vet/)\n\n- go oracle - dependencies analyser (can be integrated in editor) [oracle web site](http://golang.org/s/oracle-user-manual)\n\n- godoc - great documentation generator and viewer\n\n- gocode - autocomplete service - [gocode library website](https://github.com/mdempsky/gocode)\n\n### IDEs\n\n- IntelliJ Go plugin https://plugins.jetbrains.com/plugin/9568-go\n\n- GoLand - https://www.jetbrains.com/go/\n\n- Emacs - go-mode\n\n- Vim - vim-go\n\n- Visual Studio Code (for the workshop)\n\n- LiteIDE\n\n- SublimeText\n\n- Atom\n\n\n## Github style - project structure\n\nIn go, idiomatic way is to organise code in \"github style\", so part of the path is looking like server address to library. Of course if you want you don't need to do this, but whole ecosystem works that way.\n\n```\nbin/\n    hello                          # command executable\n    outyet                         # command executable\nsrc/\n    [github.com/golang/example/](https://github.com/golang/example/)\n        .git/                      # Git repository metadata\n\thello/\n\t    hello.go               # command source\n\toutyet/\n\t    main.go                # command source\n\t    main_test.go           # test source\n\tstringutil/\n\t    reverse.go             # package source\n\t    reverse_test.go        # test source\n    [golang.org/x/image/](https://golang.org/x/image/)\n        .git/                      # Git repository metadata\n\tbmp/\n\t    reader.go              # package source\n\t    writer.go              # package source\n    ... (many more repositories and packages omitted) ...\n```\n\nEnvironment variable `$GOPATH` is responsible for path to the root dir of `src`, `bin` and `pkg` directories.\n\n## Packages and Importing\n\n`package` in go is in form of files with directive `package package_name` on top of each file. Package by default is imported as full path to package.\n```go\nimport \"go-workshops/010-basics-importing/sub\"\n```\n## Getting and installing external packages\n\nTo get external package we need to run go install which will get sources and binaries and put them to `src`/`bin`/`pkg` directories\n\n```sh\n\ngo install external.package.com/uri/to/package\n\n```\n\n## Package managers\n\nCurrently most advanced in go ecosystem is `dep` https://github.com/golang/dep\n\nYou can init your project:\n\n\\$ dep init\n\n\\$ ls\n\nGopkg.toml Gopkg.lock vendor/\n\nafter that dep will add vendor dir where all dependencies will be loaded (In go after 1.5 `vendor` dir have preference over \"github style `$GOPATH` based directories - when compiler will not find library in vendor dir it'll try to take it from `$GOPATH`).\n\nFor more details please refer to `dep` documentation at https://golang.github.io/dep/docs/daily-dep.html\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaqvijafar91%2Fgo-workshops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaqvijafar91%2Fgo-workshops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaqvijafar91%2Fgo-workshops/lists"}