Albert Dugba🇬🇭🚀
albertdugba.bsky.social
Albert Dugba🇬🇭🚀
@albertdugba.bsky.social
Frontend Engineer
Congrats!
April 4, 2025 at 8:04 PM
You’re really raising the bar for tech content. Go Jason. 🔥🚀
March 23, 2025 at 2:31 PM
awww I grew up listening to some wild jazz from here. May she RIP
February 24, 2025 at 9:03 PM
Congrats let me be your +1 subscribers 😀
February 7, 2025 at 11:14 PM
This is a good read.
February 5, 2025 at 1:38 PM
I also learnt about pointers in Go.They store the memory address of another variable that can be useful especially when you want to mutate the data or state, it mutates the original data which is performant
February 5, 2025 at 1:27 PM
I also got a hung of receiver functions, they're basically like an oop concept, methods defined on that type
January 26, 2025 at 6:12 PM
the content must be converted from byte slices back to strings.
January 26, 2025 at 5:55 PM
Now let's talk about retrieving that data from the file system. The "os" has a utility that can be used to get the data "os.ReadFile"
Reading a data from the file system returns the []byte slice and an error

In the slice of todos, since we have a slice of todos in a string type,
January 26, 2025 at 5:52 PM
the slices of todos needs to be converted to string and then to a byte slice before writing to a file

```
os.WriteFile(fileName, []byte(t.toString()), 0666)
```
January 26, 2025 at 5:40 PM
to save to the file system. Before that, let's talk about byte slices. So byte slices is the normal slices but with a type of byte which is another data type commonly used to handle binary data. Now in our case, persisting the list of data todos needs to be in a type byte slice. but first,
January 26, 2025 at 5:38 PM
Writing to the filesystem in go requires the use of the 'os' package which has so many utilities which provides platform related interfaces. Writing to a file uses the syntax `os.WriteFile` which creates and overrides an existing data
In my little todo program, I have slices of todos that I needed
January 26, 2025 at 5:33 PM
in slices, there is only way to loop through data which is the `for loop` like this which is straightforward
January 20, 2025 at 11:09 PM
3. Functions: Just like in any other programming languages, functions in go is declared with the func keyword with the name and the body

depending on what the function is doing you might need to add a return type

for example a function returning a string should have a return type of string
January 20, 2025 at 10:57 PM