迹忆客 EN >

所有文章

Enabling CORS in GoLang

发布时间:2025/04/15 作者:JIYIK 分类:Go

This article describes how to enable and use CORS in GoLang. Go language CORS Cross-origin resource sharing (CORS) is a process based on HTTP headers that defines the origins from which browsers are allowed to load and use resources. CORS i...

查看全文

Function pointers in Go

发布时间:2025/04/15 作者:JIYIK 分类:Go

A pointer in Go is a special-purpose variable that stores the memory address of other variables and the point where the memory is located. It can also access the value stored in that memory location. Pointer declaration in Go var pointer_na...

查看全文

Duration in Go

发布时间:2025/04/15 作者:JIYIK 分类:Go

Go duration conversion can be done in a variety of ways. The time library and the time.duration method are often used to calculate and display time. Note that duration refers to the time elapsed between two defined time objects, as an int64...

查看全文

Create a new directory in Go

发布时间:2025/04/15 作者:JIYIK 分类:Go

Go has many ways to create directories, one of which is os.Mkdir . We can assign specified names and permission bits to the newly formed directory. os.MkdirAll Useful for recursively creating multiple directories, including any missing pare...

查看全文

How to read a file into a string in GoLang

发布时间:2025/04/15 作者:JIYIK 分类:Go

The Go language provides a lot of file manipulation tools, one of which is how to read files into strings. ioutil.ReadFile() , File.Read() , buf.ReadFrom() and strings.Builder are just a few of the methods that can be used to efficiently wr...

查看全文

Declaring constant Map in Go

发布时间:2025/04/15 作者:JIYIK 分类:Go

Map is a collection of key-value pairs which can be sorted in any order. It assigns values ​​to keys. The keys in a Map are always unique, but the values ​​are not always unique. The map data structure is used for fast key-based dat...

查看全文

Merge two maps in Golang

发布时间:2025/04/15 作者:JIYIK 分类:Go

This article describes how to merge two maps in Golang. Golang does not provide any in-built functionality to merge mappings, but this can be achieved using Copy method or by following the corresponding procedure. Let’s try both the metho...

查看全文

GoLang elements are maps of maps

发布时间:2025/04/15 作者:JIYIK 分类:Go

This article introduces how to create a Map of Maps in Go language. GoLang Map of Map Maps of Maps or nested maps are those maps whose key-value pairs are also maps. In Go language, you can create Maps of Maps. When we define a Map, we have...

查看全文

Golang copy slice

发布时间:2025/04/15 作者:JIYIK 分类:Go

This article introduces how to copy slices in Go language. Copying a Slice in GoLang Copying a slice in Go can be achieved by different methods. The copy() and append() methods are commonly used for this purpose, where copy() takes a deep c...

查看全文

GoLang sorting structure slices

发布时间:2025/04/15 作者:JIYIK 分类:Go

This article describes how to sort structure slices in Go. GoLang sorting structure slices GoLang provides two methods to sort a struct slice; one is sort.Slice and the other is sort.SliceStable . We also need to use the less function with...

查看全文

Getting a string representation of a structure in Go

发布时间:2025/04/15 作者:JIYIK 分类:Go

Go allows us to serialize data from structures using a variety of simple standard methods. Converting a structure to a string using String method in Go The GoLang package String helps implement simple functions to manipulate and edit UTF-8...

查看全文

Convert JSON to struct in Go

发布时间:2025/04/15 作者:JIYIK 分类:Go

This article describes how to convert JSON to struct in GoLang . Convert JSON to Struct using Unmarshal method in Go The encoding/json package of the Go language provides a function Unmarshal to convert JSON data into byte format. This func...

查看全文

Golang 中的零值 Nil

发布时间:2023/04/27 作者:迹忆客 分类:Go

本篇文章介绍 nil 在 Golang 中的含义,nil 是 Go 编程语言中的零值,是众所周知且重要的预定义标识符。...

查看全文

Golang 中的 Lambda 表达式

发布时间:2023/04/27 作者:迹忆客 分类:Go

本篇文章介绍如何在 Golang 中创建 lambda 表达式。Lambda 表达式似乎不存在于 Golang 中。 函数文字、lambda 函数或闭包是匿名函数的另一个名称。...

查看全文

扫一扫阅读全部技术教程

社交账号
  • https://www.github.com/onmpw
  • qq:1244347461

热门文章

热门标签

扫码一下
查看教程更方便