Skip to content

Instantly share code, notes, and snippets.

View riandyrn's full-sized avatar

Riandy Rahman Nugraha riandyrn

View GitHub Profile

Hello, Praveen

Thanks for the response!

Actually this article is about our unique experience in solving codebase maintainability issue as an organization by choosing Go rather than the feature of Go as programming language itself. This was why we are focusing more on the impact in our organization. 😃

Also the things that you mentioned are actually not issues for our organization. Here are the details:

  1. Error handling, it was good initially, but after writing err != nil for everything, I felt it's little annoying.
@riandyrn
riandyrn / defer_modify_return_value.go
Last active June 11, 2021 10:20
Golang - Defer Modify Returned Value
package main
import (
"errors"
"log"
)
func main() {
err := funWithoutNamedReturn()
log.Printf("error received from func WITHOUT named return: %+v", err) // the err will be nil
@riandyrn
riandyrn / GO_DEV_GUIDELINES.md
Last active April 26, 2019 03:21
Guidelines for Software Development Using Go

Go Development Guidelines

This document contains my personal notes / guidelines to develop software using Go.

The main purpose of this document is to help myself remembering how to write good code using Go in the future. The reason is because I'm working not only using Go, but also other languages such as PHP, Python, & Javascript. Each of these languages has it own unique development guidelines, style, & mindset. So in order to not confuse Go development guidelines with anything, I decided to make this document.

So I found that the approach & mindset which work best for Golang (up until now) is Hexagonal Architecture.

Here is the list of such great talk for applying Hexagonal Architecture on Go:

@riandyrn
riandyrn / self_signed_ssl_aws_alb.md
Last active December 6, 2023 22:09
Self Signed SSL Certificate for AWS Application Load Balancer

Self Signed SSL Certificate for AWS ALB

  1. Generate private key

    $> openssl genrsa 2048 > my-private-key.pem
  2. Generate certificate using private key, you will be prompted to fill some fields. Fill required fields randomly, except for Common Name fill it with *.amazonaws.com or your valid domain name

@riandyrn
riandyrn / userdata_ami_linux_install_golang.sh
Last active May 3, 2018 22:46
Initiate Fresh Installation of AMI Linux with Golang
#!/bin/bash
cd /usr/local
wget https://storage.googleapis.com/golang/go1.10.linux-amd64.tar.gz
tar -xzf go1.10.linux-amd64.tar.gz
cd /etc/profile.d
echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile.d/go.sh
echo 'export GOPATH=$HOME/go' | tee -a /etc/profile.d/go.sh
@riandyrn
riandyrn / INSTALL_GOLANG_1.13.4_AMI_LINUX.md
Last active December 18, 2021 21:23
[Install Golang 1.13.4 on AMI Linux]

Install Golang

cd /usr/local/
sudo wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
sudo tar -xzf go1.13.4.linux-amd64.tar.gz

Append Golang Binary to Path

@riandyrn
riandyrn / INSTALL_TSUNG_1.7.0_UBUNTU_16.04_AWS.md
Last active May 8, 2020 15:07
[Install Tsung 1.7.0 on Ubuntu 16.04 - AWS]

Install Tsung 1.7.0

> sudo apt-get update
> sudo apt-get install erlang -y
> sudo apt-get install make -y
> sudo apt-get install gcc erlang-dev erlang-eunit -y
> wget http://tsung.erlang-projects.org/dist/tsung-1.7.0.tar.gz
> tar -xvzf tsung-1.7.0.tar.gz
> cd tsung-1.7.0
@riandyrn
riandyrn / gist:547adcb6e428006e4c9b7f97c8cda7f1
Created September 27, 2016 23:29 — forked from homaily/gist:8672499
Regex to validate saudi mobile numbers

السلام عليكم ، هذا كود ريجيكس بسيط للتحقق من صحة أرقام الجوالات السعودية ، يقوم الريجيكس بالتحقق من مفتاح الدولة ، مفتاح شركة الإتصالات لضمان صحة النص المدخل .

Hello, this is a simple regex to validate saudi mobile numbers, the code will validate country code, telecome company code and make sure the tested sting is correct .

/^(009665|9665|\+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})$/

Regex Breakdown - شرح الكود