The Golang Journey
- Learn golang using projects
- Will build my own Database , compiler , OS soon
Latest Commit
chore: add interface exercise
Added three Go interface exercises under intermediate/interfaces/:
- exercise 1 (
excercise/main.go): Implements a customWriterinterface with aContentWriterstruct that writes a byte slice to stdout usingfmt.Printf. - exercise 2 (
excercise-2/main.go): Implements anIncrementerinterface backed by anIntCountertype that increments and returns an integer counter over 10 iterations. - exercise 3 (
excercise-3/main.go): Demonstrates interface composition โ aWriterCloserinterface (embeddingWriterandCloser) implemented byBufferedWriterCloser, which buffers incoming byte writes and flushes them in 8-byte chunks whenClose()is called.
Notes about go
- Everything in go is passed by value by default