Skip to content

Instantly share code, notes, and snippets.

View Thedrogon's full-sized avatar
🎯
Focusing

Sayanjit Mukherjee Thedrogon

🎯
Focusing
View GitHub Profile
@Thedrogon
Thedrogon / array_slice.go
Last active April 27, 2025 08:09
A Gist that shows how Arrays , maps, slices are done in Golang ...
func main(){
//Arrays in Golang
my_array := [5]int{1,2,3,4,5} // just like othesrs , arrays in go are 0 indexed.
//multidimensional arrys
matrix := [2][3]int{
{1,2,3},
{4,5,6},
}
@Thedrogon
Thedrogon / main.go
Last active April 28, 2025 15:17
A Gist that shows how functions , Conditional statements , Loops in Go
// Function in golang where we pass 2 values to get the added value
func add (a int ,b int) (int,int) {
return a+b,a*b
}
//In golang to export a function or variable , struct or function u can just capotalise the initial letter of that member
func Add (a int ,b int) (int,int) {
return a+b,a*b //NOW IN THIS CASE IT BECOMES EXPORTABLE FUNCTION.