Skip to main content


Switching Validator Language in Echo Framework #GolangDev Hello everyone, for right now I wanna share how to switch language validator in the echo framework. this framework actually using the go-playground library as its default validator. so if you wanna use a validator and have a limited example to read, just go to this repository, you can find more examples about its usability. don't forget to hit the stars, it's very useful.  In my case, I have an issue that my current project needs me to translate the validator error message from English into Bahasa Indonesia. there is an example in the go-playground validator repository that we can switch the validator message into another language. Thank god, there is an Indonesian developer who contributes that repository to translate the message into Bahasa Indonesia.  after implementing code from go-playground documentation, then I got next issue, the thing is we need to implement the current docs into the echo framework version, which is not suitable at all, you will find an e

Playing with Hooks in Gorm #GolangDev

Pixabay Hello everyone, I would like to share some tricks in gorm, the Idea of this tricks is to execute a command or code statement in the middle of an ORM operation, if you ever know about trigger in the query language, then hooks is just kinda like that. Hooks could execute statement in some events such as: beforeCreate, beforeUpdate, afterCreate,  and afterUpdate . those event is similar as a trigger,  when the trigger is executed in DBMS layer, hooks are executed in the application layer. In my real case, my current company has different convention of naming database column, so when I try to implement ORM, a lot of columns such as created_at, updated_at and deleted_at can't be generated automatically. also if you have a custom UUID you could pass the value UUID generator into hooks before the insert is executed. for more detail let's jump into code : # Explanation Above code containing model struct, and several methods from gorm to serve model, TableName method used to de

How Strict is Golang? #GolangDev Hello everyone, in this occasion I would like to share about the strictness of golang. what kind of strict? let see below. Golang is the functional programming that really have concern about performance, giving limitation to prevent overuse memory is the big deal. for example, golang has a variative type of data such as int, string, boolean, float, array etc. I wonder that you are thinking about "what kind of strictness that is? its totally similar other language", YES . but golang have specification in numeric type of data such as int have int8, int16, int32, int64 . golang also have uint8, uint8, uint32 and uint64 which is its really strict you know. the following number after type of data is stand for the length. Obviously you could use the largest type of data for all the variables, but you know it could overwhelming if you put int64 in "is_valid" variable right? joking :D. golang really care about performance, because each length of v

The Advantage of Using HTTP Default Authorization Scheme #DigitalSecurity Hello Everyone, This day I would like to introduce you to the default header for authorization in HTTP. HTTP auth scheme is a guide or standardization scheme for the authorization header in the HTTP protocol. this standard is using key Authorization in the header and followed by a value that usually filled by key or token. for example : Authorization : <type> <key/token> this standard is the solution of the key header for authorization that really random was provided by developers to build an authorization header for their application, in my experience, developers used to "token" for their key in the header that usually followed by the hash value. the random key makes developers using more time for writing code for getting header key and validating the value which is you could use the library and focus on writing the logic of your application. Depend on Mozilla site , HTTP auth scheme divided by 4 types, such as : Basic  (see  RF

Variadic Function vs Slice Param Function in Golang #GolangDev Hello everyone, good to see you again. I am gonna share about a simple thing in fundamental Golang, this article inspired by a QnA in a website and I think I will tell the answer more flexible and wider in my personal tutorial, so this is about differentiation between Variadic Function and Slice Param in Function. # Variadic Function Variadic function is an unique code, this code is enable us to passing a infinite params in one function, we know that we need to put parameters in function we need to put the space in there, for example : function(param1 int, param2 string), golang absolutely doing that thing too, seems like the other languages, but Variadic function is a something new, you could put many value in function and sapparated by comma, you maybe thing about passing array in parameters but this is something different, you dont need to put parenteses when you call the function, it just like you put regular parameters but have an infinite numbers.  for ex

Create MVC Pattern Using Echo Framework #GolangDev Hi, Back again. today I am gonna share about Go Language, yes it is a new programming language that really fast growing this day, so many startup using it, especially in indonesia, there is a Gojek, Dana, Tiket and many more. Go Lang is a programming language found by google engineer, this language is a multi paradigm language, you could use it as functional programming or treat it like an OOP bases. Echo is an framework that use Golang as a main language, to use a fast and reliable backend/web apps, as you know Golang has a really fast performance than other language, one of the reason is because its compiled not interpreted, so the Echo claim that its 10x faster. insane right ? Actually I didn't test the performance yet, but yeah for newbie like me in golang its not the main thing that you must understand, so the thing that we should know is how we actually can do with Golang.  I am person with MVC bases, before jump to golang, I have experience with La

Making a Segue Between Storyboard Part II #IOSDev

Hello everyone, in this tutorial i would like to continue my last tutorial about segue, if you dont have read it yet, just go to this link . in this tutorial i would like to show you how to switch between view controller using programmatically in swift. interesting right? so here it is. prerequisite: * create new project * know how to put segue by drag and drop firstly, open last xcode project about segue in the first tutorial. and then add new viewcontroller. like bellow connect segue from first viewcontroller to third viewcontroller by dragging first viewcontroller icon and drop it to third viewcontroller, you could use ctrl+click to drag and drop. after you drop, you will face new popup window, choose "show" like bellow  click on the segue path link like bellow on the right side bar, you will see some menu, choose the attribute menu. and then you can see identifier option right there. fill the identifier as you want, in