{"id":18734901,"url":"https://github.com/1995parham-teaching/go-lecture","last_synced_at":"2025-04-12T19:11:37.084Z","repository":{"id":50904941,"uuid":"197543044","full_name":"1995parham-teaching/go-lecture","owner":"1995parham-teaching","description":"Introduction to Go :wave: also used in IE Course","archived":false,"fork":false,"pushed_at":"2024-04-29T04:20:43.000Z","size":506,"stargazers_count":24,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-19T03:03:40.438Z","etag":null,"topics":["course","go","golang"],"latest_commit_sha":null,"homepage":"https://1995parham-teaching.github.io/ie-lecture/lectures/lecture-7/#/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1995parham-teaching.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-07-18T08:13:48.000Z","updated_at":"2024-04-29T04:20:47.000Z","dependencies_parsed_at":"2023-07-12T21:01:50.053Z","dependency_job_id":"d08ef753-fcf9-4696-9746-f78987268922","html_url":"https://github.com/1995parham-teaching/go-lecture","commit_stats":null,"previous_names":["sbu-ce/ie-with-go","cng-by-example/hello-go","1995parham-teaching/hello-go"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-teaching%2Fgo-lecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-teaching%2Fgo-lecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-teaching%2Fgo-lecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-teaching%2Fgo-lecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1995parham-teaching","download_url":"https://codeload.github.com/1995parham-teaching/go-lecture/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618277,"owners_count":21134200,"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":["course","go","golang"],"created_at":"2024-11-07T15:15:12.209Z","updated_at":"2025-04-12T19:11:37.059Z","avatar_url":"https://github.com/1995parham-teaching.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e🐼 Learning Go 🤓\u003c/h1\u003e\n\u003ch6 align=\"center\"\u003eLearn to develop cloud-native programs with Go!\u003c/h6\u003e\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"banner\" src=\"./.github/assets/banner.jpg\" height=\"200px\" /\u003e\n  \u003cbr /\u003e\n  \u003cimg alt=\"GitHub Actions Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/1995parham-teaching/go-lecture/build.yaml?style=for-the-badge\"\u003e\n\u003c/p\u003e\n\n## Introduction\n\nThe Golang programming language is very similar to the C programming language,\nand its purpose is to reduce complexity in program development.\nThis language is widely used to implement web servers, applications, and container management tools.\nAmong the tools that have been developed with this language are:\n\n- [Kubernetes](https://github.com/kubernetes/kubernetes)\n- [Docker](https://github.com/moby/moby)\n- [NATS](https://github.com/nats-io/nats-server)\n- [Prometheus](https://github.com/prometheus/prometheus)\n\nIn the last few years, this language has opened its place in Iranian companies,\nand it is used for the development of backend services.\n\n\u003e [!NOTE]\n\u003e C background is **required** for learning Go.\n\n## Outline (As a separate course)\n\n- History\n- Variables and constants\n- Calculation\n- Conditions\n- Loops\n- Functions\n- Strings\n- Arrays and slices\n- `map`\n- `struct`\n- `interface`\n- Pointers\n- Errors\n- Concurrency and channels\n- `select`\n- `go mod` and using packages\n- An overview of advanced features\n- Introduction to HTTP protocol\n- HTTP server implementation\n- Settings management paragraph\n- Metric, Log and Tracing\n- connection with the database using PostgreSQL and GORM\n- Introduction to Docker and containerization\n\nAt the beginning of the course, an introduction to the Go language is made and students implement simple programs with it.\nSince the implementation of web servers is one of the important uses of the Go programming language,\nwe will review the structure of the HTTP protocol and then implement a simple web server in Go.\nIn this implementation, we try to familiarize ourselves with the structure of large programs created in Go and review details such as\nConfiguration or Metrics, which are of great value in real systems.\nFinally, a MongoDB and PostgreSQL databases are added to this web server,\nthe purpose of which is to familiarize students with database interfaces in the Go.\n\n## Outline (As a part of internet engineering course)\n\nUsing Go for design and implementing servers contains two major steps.\nFirst is about learning Go itself and another step is learning an HTTP framework (here we go with Echo).\nReviewing these source codes are useful for learning Go but there aren't enough.\n\n### Go\n\n0. Hello World\n1. Constants and Variables\n2. Calculation\n3. Conditions\n4. Loops\n5. Strings\n6. Arrays\n7. Slices\n8. Arrays and Slices\n9. Maps\n10. Structs\n11. Interfaces\n12. Pointers\n13. Structs with Pointers\n14. `strconv`\n15. Function with multiple-return\n16. Errors\n17. Concurrency\n18. Function Type\n19. Channels\n20. Pipelines\n21. Select\n22. JSON\n23. `go.mod`\n24. Packages\n\n### Echo\n\n0. Say hello to Echo\n1. HTTP Handlers\n2. Request Binding\n3. Path Parameters\n4. Query Strings\n\n## Continue your journey 🧳\n\nYou can visit [Go101](https://github.com/1995parham-learning/go101) which contains\nsome more advance concepts of Golang.\n\n## Review Me\n\nOne of the main steps in learning new language and its best practices is reviewing\nwritten projects:\n\n- \u003chttps://github.com/1995parham/koochooloo\u003e:\n\n  - In the first step, you need to review the project structure and find out how modules are related\n  - Then we continue with running the docker-compose to have the requirements\n  - And in the final step, we lunch the application and trying it with curl based on its swagger\n  - This project use zap as a logger and pass it into its modules also each module\n    has its metrics based on [otel](https://github.com/open-telemetry/).\n\n- \u003chttps://github.com/1995parham/fandogh\u003e:\n\n  - This example containing the migration and how we store things on the [MongoDB](https://www.mongodb.com/) database.\n\n- \u003chttps://github.com/1995parham/saf\u003e:\n\n  - This example shows tracing in action with [NATS](https://nats.io/) as a message queue.\n  - Also, We can use profiler to see how replacing [Echo](https://echo.labstack.com/) with [GoFiber](https://gofiber.io/) increase the performance.\n  - This project has Helm chart and after knowing Kubernetes basis we can lunch it on the cloud with its Helm.\n\n- \u003chttps://github.com/1995parham/k1s\u003e:\n  - In the first step, we review the server structure. The server is stateless and only returns simple responses.\n  - We it on the cloud with its manifests\n  - using server and ingress to send requests and see how they distributed between instances\n  - We also see how we can mount configuration on Kubernetes with [configmap](https://kubernetes.io/docs/concepts/configuration/configmap/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1995parham-teaching%2Fgo-lecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1995parham-teaching%2Fgo-lecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1995parham-teaching%2Fgo-lecture/lists"}