cosmos official scanner_ hunt_ Game test project deployment

scavenger hunt game cosmos official waste picker hunting game operation and deployment details / key records, as well as document translation Official address: The Game | Cosmos SDK Tutorials The translation part of the document comes from: https://blog.csdn.net/lk2684753/article/details/113849468 1. Install starport starport is the offi ...

Posted by Ange52 on Tue, 12 Apr 2022 10:21:51 +0300

Channel details

catalogue 1, Channel introduction 1. Claim channel 2. Create channel 2, channel operation 1. Send 2. Receive 3. Shut down 3, Unbuffered channel 4, Buffered channel 5, Cyclic read channel 6, Close channel 7, Unidirectional channel 1, Channel introduction Simply executing functions concurrently is meaningless. Functions need ...

Posted by minidak03 on Tue, 12 Apr 2022 04:52:38 +0300

Golang backend learning notes - 5 Write unit tests for database CRUD using golang

In the previous section, I learned How to generate automatic Golang CRUD code , this section will learn how to write unit tests for these CRUD operations. 1. Test CreateAccount From account sql. Start with CreateAccount in go and create a new file account in the db/sqlc directory of the project_ test. go There is a convention in Golang t ...

Posted by dp777 on Mon, 11 Apr 2022 03:15:49 +0300

encoding/json package of GoLang

encoding/json package of GoLang Note: This article is based on go SDK V1 on Windows system 8. Explain 1.JSON introduction json is particularly important in front and back separated development, because it is an important hub for linking the front and back ends json is a syntax for storing and exchanging text information. It is similar ...

Posted by madhu on Sat, 09 Apr 2022 13:44:45 +0300

go's Context is basically used

Getting started with Context outline What is Context Why use context Basic use of Context Context interface implementation Usage scenario Summary 1. What is Context Its main function is to control the life cycle of goroutine. Context is usually referred to as context, which can be understood as: the running state and site of goroutine. ...

Posted by Tandem on Fri, 08 Apr 2022 18:22:56 +0300

[Go advanced basic characteristics] defer

defer is a keyword we often use. It will execute the incoming function before the current function returns. It is often used to close file descriptors, close database connections and unlock resources.Usage scenarioRelease resourcesThis is the most common usage of defer, including releasing mutex, closing file handle, closing network connection, ...

Posted by robster on Fri, 08 Apr 2022 12:06:39 +0300

go language learning - array, string and slice (to be continued)

arrayThe array of Go language is a value type. Although the elements of the array can be modified, the assignment of the array itself and the transfer of function parameters are handled in the way of overall replication.Definition methodvar a [3]int // Define an int array with a length of 3, and all elements are 0 var b = [.. ...

Posted by PRodgers4284 on Fri, 08 Apr 2022 05:04:39 +0300

On the limitations of Go 1.18 generics

preface After go version 1.18, generics was officially introduced, which is called type parameters. This paper briefly introduces the use of generics in go. For a long time, go has no concept of generics. Only the interface occasionally acts as a generic. However, the interface can not meet some basic Generic requirements. For example, in this ...

Posted by phrygius on Thu, 07 Apr 2022 13:23:59 +0300

Practice GoF's design pattern: Singleton pattern

Singleton mode can also realize polymorphism. If you predict that the singleton may be extended in the future, you can design it as an abstract interface to make the client rely on abstraction. In this way, there is no need to change the client program during future expansion. The design of network is also very simple. A hash table maintains th ...

Posted by helloise on Thu, 07 Apr 2022 07:16:13 +0300

New feature of Go 1.18: multi module workspace mode

Absrtact: Go 1.18 launched the multi module workspace mode to support multiple workspaces of modules. Let's see what's special. This article is shared from Huawei cloud community< Let's take a look at the multi module workspace mode of the new features of Go 1.18 >, author: a drop in the universe. introduction In 2022, the Go team release ...

Posted by nemonoman on Wed, 06 Apr 2022 06:53:42 +0300