Offer to come, dig friends take it! I am participating in the 2022 Spring Recruit Punch card activity. Click here for details.

Spring Recruit punch card day 14 chapter 17.

Today, we will continue to update the Go learning record, introducing a very good framework recently discovered: GoFrame.

Recently found a very easy to use based on go language Web development framework, very suitable for PHP to go students to use, in many design ideas and use and PHP Laravel framework is very similar.

Today I’ll give you a brief introduction to the features of GoFrame

The official introduction

GoFrame is a modular, high-performance, enterprise-level Go infrastructure development framework. GoFrame is not a WEB/RPC framework, but a universal basic development framework, which is an enhanced extension of Golang standard library. It contains basic development components of common core, and has the advantages of practical, modular, comprehensive documentation, abundant modules, high ease of use, strong universality and team-oriented.

My experience

The official documentation details the framework’s features, which I won’t go over.

Now LET me share my learning experience as a user and a learner.

Design idea

The design idea is the soul of GoFrame frame and the indispensable internal work method for users. GoFrame has its own unique design idea, understand the design idea of GoFrame, you will understand all of GoFrame.

Like PHP’s Laravel, GoFrame’s design philosophy is worth learning from.

Study suggest

Those who have the foundation

For those with basic knowledge, it is recommended that you familiarize yourself with the framework design, get started quickly, and then focus on the core components

Eloquent Eloquent Eloquent Eloquent Eloquent Eloquent Eloquent Eloquent Eloquent Eloquent

Let me take an example to let you experience, from some details of the design we can clearly feel the designer of PHP to go developers friendly.

Object management related:

Array is also the alias for slice, which is supposed to meet PHP’s habit of switching to Go. PHP’s Array is more like Golang’s slice, because go’s Array has a fixed length.

Type (Var = gvar.var // is a generic variable, similar to the generic Ctx = context.context //context. context alias) //Map is the key value of the original Map. Map = Map [string]interface{} MapAnyAny = Map [interface{}]interface{} // MapAnyAny is alias of frequently-used map type map[interface{}]interface{}. MapAnyStr = map[interface{}]string // MapAnyStr is alias of frequently-used map type map[interface{}]string. MapAnyInt = map[interface{}]int // MapAnyInt is alias of frequently-used map type map[interface{}]int. MapStrAny = map[string]interface{} // MapStrAny is alias of frequently-used map type map[string]interface{}. MapStrStr = map[string]string // MapStrStr is alias of frequently-used map type map[string]string. MapStrInt = map[string]int // MapStrInt is alias of frequently-used map type map[string]int.  MapIntAny = map[int]interface{} // MapIntAny is alias of frequently-used map type map[int]interface{}. . . . ) //List is a map slice type (List = [] map ListAnyAny = []MapAnyAny // ListAnyAny is alias of frequently-used slice type []MapAnyAny. ListAnyStr = []MapAnyStr // ListAnyStr is alias of frequently-used slice type []MapAnyStr. ListAnyInt = []MapAnyInt // ListAnyInt is alias of frequently-used slice type []MapAnyInt. ListStrAny = []MapStrAny // ListStrAny is alias of frequently-used slice type []MapStrAny. ListStrStr = []MapStrStr // ListStrStr is alias of frequently-used [] mapstrstr. ListStrInt = []MapStrInt // ListStrInt is alias of frequently used.. Slice = []interface{} // Slice is alias of frequently-used slice type []interface{}. SliceAny = []interface{} // SliceAny is alias of frequently-used slice type []interface{}. SliceStr = []string // SliceStr is alias of frequently-used slice type []string. SliceInt = []int // SliceInt is alias of frequently-used slice type []int. ) //Array is also an alias for slicing, which is supposed to meet PHP's habit of going from Array to golang. PHP's Array is more like golang's Array because of the fixed length of go's Array. type( Array = []interface{} // Array is alias of frequently-used slice type []interface{}. ArrayAny = []interface{} // ArrayAny is alias of frequently-used slice type []interface{}. ArrayStr = []string // ArrayStr is alias of frequently-used slice type []string. ArrayInt = []int // ArrayInt is alias of frequently-used slice type []int. )Copy the code

Students who have no foundation

If you don’t have the basic knowledge of GO, I suggest you learn the basic grammar of GO first, read my go language learning column in Denver, which has attracted more than 60 followers, and then look at the frame of GoFrame.

Only after understanding the basis of Go language, can we better understand the advantages and use skills of GoFrame.

For example, when we do PHP, we must learn the basic syntax of PHP first, and then learn TP, Laravel and other frameworks.

For those who have PHP foundation but no go language foundation, switching to GO is relatively easy.

Maybe it’s just not as flexible as PHP, so it’s a pleasure to try GO’s rigorous standardized development.

The website address

I will not do the duplication of copy and paste work, and I suggest you check the official website below for more content.

The latest version is 2.0

A small pit

In the process of viewing the document, we cannot obviously know the version of the current document, I have submitted this problem to the community, the current reading suggestion is as follows, we pull the page to the top, click here in the upper left corner to switch the version.

The last

Thanks for reading and welcome to like, favorites,coin(attention)!!