[Golang] Using Operator On Gin Golang

The use of operators in a system is one of the most important things a developer uses when he wants to produce a value or when he wants to connect one value to another.

There are several types of operators that are commonly used:

First, arithmetic operators.
Arithmetic operators are commonly used to perform arithmetic calculations

Some arithmetic operators commonly used are as follows:

Arithmethic Operators

The second, comparison operator
Comparison operators are commonly used to compare a value with another.

Some of the comparison operators commonly used are as follows:

Comparison Operators

Third, logical operators
logical operators are used to determine whether a combination of data is true or not.

Some of the logical operators commonly used are as follows:

Logical Operators

After knowing the various operators, now let’s get into the discussion, namely the use of the gin golang operator

Please create a gooperator folder in the GOPATH folder.

Then in the gooperator folder, please create a config folder and create a file named config.go. This file will later function as a port identifier that we use.

Then type the following code:


After that, create an operator folder outside the config folder, create a file arithmetic.go

Then type the following code:


still in the operator folder, please create comparison.go and logical.go files

Then type the following code:


Then please create a struct folder outside the operator folder. And create a Valuetype.go file

Then type the following code:


After all the operator files have been created, we will create a main.go file outside the operator folder

Then type the following code:


If all the steps have been completed, please run the following API:

  1. Arithmetic Operators API
    http: //localhost: 5002/api/v1/gooperator/arithmeticopr

2. Comparison Operator API
http: //localhost: 5002/api/v1/gooperator/comparisonopr

3. Logical Operator API
http: //localhost: 5002/api/v1/gooperator/logicalopr

Finally we have successfully implemented the use of operator on gin golang

Happy Coding :)




All about go language

Recommended from Medium

What’s New In Python 3.10

Continuous Integration for Angular Projects with TravisCI

Submitting Your App To The Apple App Store In 2019 — A Comprehensive Technical Guide For Beginners

A look at the most used P2P Protocols

Basic physics in Unity

Web & Desktop UI Component Libraries for Designers

Self hosting kubernetes

MUGA Construction in Oakley #Multi #Use #Games #Area #Construction #Oakley https://t.co/IgKpJ5UD7W

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Amiruddin Saddam

Amiruddin Saddam

Backend Engineer at Jamtangan.com And will always learn something new.

More from Medium

Echo 101: Get service metadata from Web UI

Golang — basic unit testing and benchmarking

【Go】Implement SHA256, encryption and hashing in Go