Welcome To Golang By Example

Menu
  • Home
  • Blog
  • Contact Us
  • Support this website
Menu

Tag: golang

Delete a file in Go (Golang)

Posted on February 23, 2020February 23, 2020 by admin

os.Remove() function can be used to delete a file in Golang. Below is the signature of this function Code: Output:

Write multiline string in Go (Golang)

Posted on February 23, 2020February 23, 2020 by admin

A backquote (`) can be used to write a multiline string in Golang. Note that a string encoded in backquotes is a raw literal string and doesn’t honor any kind of escaping….

Check if a string is a number in Go (Golang)

Posted on February 23, 2020February 23, 2020 by admin

strconv.Atoi() function can be used to check if the string is a number. If this function returns an error if the passed string is not a number. This function parses the number…

Get number of currently running/active goroutines

Posted on February 23, 2020February 23, 2020 by admin

NumGoroutine function of runtime package can be used to know the currently running/active goroutines. https://golang.org/pkg/runtime/#NumGoroutine Below is the signature of the function Working Code: Output:

Download an image or file from a URL in Go (Golang)

Posted on February 21, 2020September 26, 2020 by admin

Overview Below are the steps to download an image or a file from a URL use http.Get(URL) function to get the bytes of the file from the URL. Create an empty file…

Create a new time instance in Go (Golang)

Posted on February 3, 2020February 3, 2020 by admin

In Go time.Time struct is used to represent an instance of time or date. Below are three ways of creating a new time instance Using time.Now() time.Now() function can be used to…

Time/Date Formatting in Go

Posted on January 25, 2020January 25, 2020 by admin

If you have worked with time/date formatting in other languages you might have noticed that the other languages use special placeholders for time/date formatting. For eg ruby language uses %d for day…

Get age given a DOB in Go (Golang)

Posted on January 23, 2020January 24, 2020 by admin

This tutorial will talk about how given a date of birth we can compute the age of a person. go-age comes to our rescue for doing that. It also takes into account…

Get Current Working Directory in Go (Golang)

Posted on January 16, 2020January 16, 2020 by admin

os.Getwd() is used to get the current working directory. Output will similar to pwd command on linux Output: Current Working Direcoty: <will be current working directory on the machine>

Iterative Binary Search Tree in Go (Golang)

Posted on January 15, 2020January 15, 2020 by admin

Introduction A binary search tree abbreviated as BST is a binary tree. For each node in a Binary Search Tree Value of each node in the left  subtree is less than the…

Posts pagination

Previous 1 … 37 38 39 … 41 Next
Follow @golangbyexample

Popular Articles

Golang Comprehensive Tutorial Series

All Design Patterns in Go (Golang)

Slice in golang

Variables in Go (Golang) – Complete Guide

OOP: Inheritance in GOLANG complete guide

Using Context Package in GO (Golang) – Complete Guide

All data types in Golang with examples

Understanding time and date in Go (Golang) – Complete Guide

©2025 Welcome To Golang By Example | Design: Newspaperly WordPress Theme