Welcome To Golang By Example

Menu
  • Home
  • Blog
Menu

Tag: file

Change file permissions in Go (Golang)

Posted on April 17, 2023April 17, 2023 by admin

os.Chmod() function can be used to change the permissions of an existing file. Below is the signature of the function Code Output:

Make a copy of a file in Go (Golang)

Posted on April 16, 2023April 16, 2023 by admin

In this article we will see two methods of copying a file. First Method io.Copy() can be used to create a copy of the file from src to dest. A successful copy…

Rename file or folder in Go (Golang)

Posted on April 15, 2023April 16, 2023 by admin

Overview os.Rename() function can be used to rename a file or folder. Below is the signature of the function. old and new can be fully qualified as well. If the old and…

Create an empty file in Go (Golang)

Posted on February 21, 2023February 21, 2023 by admin

Overview os.Create() can be used to create an empty file in go. The signature of the function is Basically this function Create a named file with mode 0666 It truncates the file…

Append to an existing file in Go (Golang)

Posted on January 17, 2023January 17, 2023 by admin

os.OpenFile() function of the os package can be used to open to a file in an append mode and then write to it Let’s see an example. In the below program: First,…

Touch a file in Go (Golang)

Posted on January 16, 2023February 23, 2023 by admin

Touching a file means Create an empty file if the file doesn’t already exist If the file already exists then update the modified time of the file. Output: When running the first…

Read a large file Line by Line in Go (Golang)

Posted on October 19, 2023November 12, 2023 by admin

When it comes to reading large files, obviously we don’t want to load the entire file in memory. bufio package in golang comes to the rescue when reading large files. Let’s say…

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

©2023 Welcome To Golang By Example | Design: Web XP