Open in app

Sign In

Write

Sign In

Daryl Ng
Daryl Ng

38 Followers

Home

About

Pinned

Why you need to avoid using append in Go

append is the go to function when you are adding an element to a slice. But is it the best way to do so? Short answer, no it isn’t. Here’s why… First, let’s create two functions that adds or assigns "x" to a string slice. WithAppend calls append to add…

Golang

2 min read

Golang

2 min read


Apr 5

Why you should avoid pointers in Golang

Go is a modern programming language that has gained popularity due to its simplicity, readability, and efficient memory management. One of the key features of Go is its ability to handle memory automatically through garbage collection. However, Go also supports pointers, which can be a powerful tool in certain cases…

Golang

3 min read

Golang

3 min read


Apr 4

Pointers in Golang

Go (often referred to as Golang) is a popular programming language known for its simplicity, concurrency support, and efficient memory management. One of the fundamental concepts in Go is pointers, which allow programmers to work with memory directly. …

Golang

2 min read

Golang

2 min read


Apr 3

How to build a microservice with Golang

Microservices are a popular architectural pattern that allows software applications to be broken down into small, independent services. Each service can be developed, deployed, and scaled independently, making it easier to manage and maintain large, complex applications. …

Golang

3 min read

Golang

3 min read


Aug 18, 2021

Build a serverless request poller on AWS

Here is a simplified architecture of the serverless request poller. The idea is to send the message to AWS SQS, which will then be picked up by AWS Lambda. …

AWS

2 min read

Build a serverless request poller on AWS
Build a serverless request poller on AWS
AWS

2 min read


Feb 19, 2021

Why you should avoid ioutil.ReadAll in Go

When you have an io.Reader , the most common way to read is with ioutil.ReadAll but it is not the best and most efficient way. So here are three functions to compare the different methods to unmarshal JSON from an io.Reader … With ioutil.ReadAll func IOUtilReadAll(reader io.Reader) (map[string]interface{}, error) {…

Go

2 min read

Go

2 min read


Feb 17, 2021

Switch better than if-else in Go?

I am sure you have wondered if switch is more efficient than if-else, or vice versa. So here is a little experiment to compare them. If-else func If(i int) bool { if i == 1 { return true } else { return false } } 2. Switch with no condition …

Golang

1 min read

Golang

1 min read


Published in

NE Digital

·Feb 16, 2021

Unit testing in Go and its importance

I think we can all agree that we did not enjoy writing unit tests when we first started coding. We want to write for new features and maybe some occasional bug fixes. Then comes the day when we need to refactor or make some improvements… and BOOM! Unit testing in…

Go

3 min read

Go

3 min read


Feb 6, 2021

How to concatenate strings efficiently in Go

Have you ever wonder if you are concatenating strings efficiently? I did, and so here are the results. But first, let’s discuss on three ways to concatenate strings. 1. Concatenation using + The easiest and cleanest way to concatenate strings is to use + . foobar := "foo" + "bar" 2. Concatenation using strings.Builder Another way is with…

Golang

2 min read

Golang

2 min read


May 11, 2020

How to update WordPress with SELinux enabled

Are you getting permission errors when you update WordPress with SELinux enabled? And facing similar errors you when you install plugins like W3 Total Cache? You are not alone! I had experienced this problem some time ago and it took me several hours to realize that it is due to…

Apache

2 min read

Apache

2 min read

Daryl Ng

Daryl Ng

38 Followers
Following
  • Max

    Max

  • Sammy Abdullah

    Sammy Abdullah

  • Aviv Carmi

    Aviv Carmi

  • Egor Romanov

    Egor Romanov

  • Beck Moulton

    Beck Moulton

See all (75)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams