This repository contains minimal examples and code snippets for various topics in Go programming language.
-
Hello, World!
- Simple "Hello, World!" program to get started with Go.
-
Variables and Constants
- Basic examples showcasing the use of variables and constants.
-
Control Structures
- Examples demonstrating if statements, loops, and switch statements.
-
Functions
- Introduction to functions, parameters, return values, and named return values.
-
Slices and Maps
- Basics of slices and maps in Go.
-
Error Handling
- Examples of error handling using the
error
interface.
- Examples of error handling using the
-
Concurrency
- Introduction to goroutines and channels for concurrent programming.
-
Structs and Interfaces
- Creating and using structs, defining interfaces, and polymorphism.
-
Testing
- Writing basic tests for Go functions using the testing package.
-
Web Development
- A simple web server using the
net/http
package.
- A simple web server using the
-
Database Operations
- Minimal example demonstrating basic database operations using SQLite and
database/sql
.
- Minimal example demonstrating basic database operations using SQLite and
To run the examples, follow the instructions provided in each respective section. Make sure you have Go installed on your machine.
Some examples may require external packages. Make sure to install them using the following command:
go get -u <package-import-path>
Replace <package-import-path>
with the actual import path of the required package.
This project is licensed under the MIT License - see the LICENSE file for details.