The origin of

I learned the Go language thanks to my colleague [Little Genius], who is now called “Little genius”.

Little Genius is a front end developer. I recruited him about two years ago, and the two of us really enjoyed each other.

Little genius thought I was very reliable, gave up a few higher salary offer; In order to enter the office smoothly, I also communicated with my boss and leader to strive for welfare and so on.

The environment

A good working environment often leads to good results.

In the past two years, the team of Little Genius and I reconstructed the company’s CMS, small programs, websites, activities and other projects, using LARavel framework of PHP in the back end and VUE and Nuxt framework in the front end. During this period, I grew up a lot. I was mainly responsible for the back-end development and part of the product prototype work, and the little genius took in both the front and back ends of technology.

An opportunity to

We did not have a lot of work before the Chinese New Year last year, so we had a chance to push the project up again. We both have high performance ambitions and have privately discussed the features of Go, its natural support for high concurrency and so on! But not in depth, so they went to find tutorials, less than a week.

Grope for

I bought a set of 79 Go tutorials at Learnku. Because I bought a full set of Laravel courses before, I really recognize learnku community. So I bought the Go one, too.

But the Go language tutorial is really in a fog. Maybe the basic reason, in short, there is no entry.

Little genius in B station to find [Li Wenzhou] teacher Go language video tutorial, very good. I highly recommend it.

Video link

The blog link

At that time, there were project demands coming in, and in order to make it easy for the little genius to have enough time to learn Go (the little genius is really crazy about learning new technology and can’t disrupt the rhythm of my genius), I took most of the demands by myself.

With one

Finally, after one week, I finished the new requirements and had enough time to learn Go. I was following the old path of the little genius, watching video tutorials and reading the knowledge points he had already learned.

As we walked downstairs, we talked about the problems we encountered today. He could review the knowledge and I could get a preview of what was coming up. One for review and one for preview.

It’s a great way to ask each other questions and answer each other. We can quickly clarify the context of knowledge, can explain to each other that they have a deeper understanding.

But I think the distance between genius is a little big, don’t watch the video, brush Li Wenzhou teacher’s blog, write instance code. Each piece of code I knock at least 3 times: the first time to sort out the train of thought comments, blind knock; The second time to compare the difference between my code and the example, to optimize the thinking; The third time to delete the notes, completely from the beginning to the end of 1~2 times.

Because I think programming is a crafty work, technical work, must do more!

Must do more!

Must do more!

Fall project

Before the Spring Festival, the company made a somewhat complicated H5 activity, similar to alipay collecting 5 blessings. We both decided to write it with Go.

Little genius start thief quick, I just finished the prototype, design table structure, little genius with Go to write the core logic demo.

On the basis of the demo, I continue to write the allocation scheme, the number of new pull cards of different probability sets, and the cost of backward push activities, etc.

With this data base we can confidently write business logic.

In the end, this project was the work of the little genius. I checked the code logic and did enough tests.

The effect of the activity is very good, to our company’s public number pull new more than 10 thousand +, the boss is very satisfied.

The advanced

Because the boss is very satisfied, the Lantern Festival and a wave of similar activities.

This is mainly my work, in the little genius Spring Festival activities based on the optimization of part of the code, this is the legendary standing on the shoulders of giants ~

Let me outline the technical points we used:

  • Deployed Nginx
  • Cross-platform compilation
  • goroutine
  • channel
  • gorm
  • Gin framework
  • Redis cache
  • Log statistics
  • Logging in to middleware
  • Cors middleware
  • The session middleware
  • reflection
  • Read-write lock

Conclusion reflection

It is difficult to walk alone, but easy to walk together.

I was willing to write when I was at school, and I was pretty good at it.

After work has been addicted to the code can not extricate themselves, abandoned the code word this talent point.

Fortunately, I caught up with the “Gold Go” theme month, which ignited my morale. Yes, I just love your big tea POTS.

(There is another thing: a chance to communicate with the big guy technology, big guy thought I was too careless, although can work, and the efficiency is considerable, but the foundation is weak, precipitation is insufficient.)

I am considering writing a blog to summarize, it is a very good choice!

After the

I later in the code of leisure, must think more, more summary.

Strive for a few more have depth, good articles have dry goods out.

Send blessings

I wish everyone in the process of becoming Gopher, steadfast, good at every day, as soon as possible!