Hello, I'm Ganesh Kumar. I'm working on git-lrc: a Git hook for Checking AI generated code.
AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.
git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.
In my previous post, we learned about defer in Goβwhere and how it is used. Now, let's dive into reference types.
Reference Types
There are five main reference types in Go:
- Pointers
- Slices
- Maps
- Channels
- Functions
The basic difference between value types and reference types is that value types are copied when assigned to a variable or passed to a function, while reference types are not.
Now, let's learn about Pointers.
Pointers
Go includes a concept called pointers. Using pointers, we can directly access and work with the memory address of a variable.
package main
import "fmt"
func main() {
i, j := 42, 2701
p := &i // p points to i
fmt.Println(*p) // Read i through the pointer (dereferencing)
*p = 21 // Set i through the pointer
fmt.Println(i) // See the new value of i
p = &j // p now points to j
*p = 13 // Set j through the pointer
fmt.Println(j) // See the new value of j
fmt.Println(p) // Print the memory address stored in p
}
Output:
gk@jarvis:~/exp/code/rd/go-exmaple$ go run main.go
42
21
13
0xc000012130
In Go, & is the address-of operator, and * is the dereference operator.
Therefore, p := &i means that p is a pointer to the variable i.
Conclusion
In this we learned about pointers and how it is used.
Now let's learn about struct data type.
π Check out: git-lrc
Any feedback or contributors are welcome! Itβs online, open-source, and ready for anyone to use.
β Star it on GitHub:
HexmosTech
/
git-lrc
Free, Unlimited AI Code Reviews That Run on Commit
git-lrc
Free, Unlimited AI Code Reviews That Run on Commit
AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.
git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.
See It In Action
See git-lrc catch serious security issues such as leaked credentials, expensive cloud operations, and sensitive material in log statements
git-lrc-intro-60s.mp4
Why
- π€ AI agents silently break things. Code removed. Logic changed. Edge cases gone. You won't notice until production.
- π Catch it before it ships. AI-powered inline comments show you exactly what changed and what looks wrong.
- π Build a habit, ship better code. Regular review β fewer bugs β more robust code β better results in your team.
- π Why git? Git is universal. Every editor, every IDE, every AIβ¦

Top comments (0)