Moment For Technology

Programmers or yards farmers | Go on topic

Imagine a scenario. At work, have you ever come across such a person? Do what you tell him to do, and don't think about what to do next when you're done. Will what you do this time have an impact on the future? How should I optimize and so on. Of course, it will not summarize the problems encountered this time, let alone do a review in the future. People around you, as long as they encounter problems start to nervous. As soon as you come across a question you don't know...

22 Go Common concurrency modes and models

Traditional programming languages such as C++, Java and Python, their concurrent logic is based on operating system threads. Communication between concurrent execution units (threads) takes advantage of the operating system-provided primitives for thread or interprocess communication. Such as: shared memory, signals, pipes, message queues, sockets, etc. The most widely used of these communication primitives is shared memory. If you've ever used this sharing...

Go Language Bible study take notes. Day7 | Go Theme month

Packages and files Packages in Go are similar in concept to libraries or modules in other languages, with the goal of supporting modularity, encapsulation, separate codification, and code reuse. The source code for a package is stored in one or more source files with the file suffix.go, usually one

I spent 30 days sorting out some GO language learning materials. Please come on in 2019

Google's son, Go, is at the top of the heap because of its concurrency. Although GO language, which appeared in the 21st century, cannot replace C++ as expected, its near-C execution performance, development efficiency of near-analytic language and near-perfect compilation speed have become popular all over the world. Especially in cloud projects, most of which are developed using Golang, I have to say, Gola...

Golang's GC performance optimization tips

When slice's capacity is less than 1024, the capacity grows by a factor of two. When the capacity is greater than 1024, the capacity is increased 1.25 times. Consider the following example: appendOne does not specify the initial capacity; appendMany specifies the initial capacity. Run the benchmark test: AppendMany...

Defer and Panic are executed in go

?? go defer and Panic execute the order. ? can first look at the following Demo. Output: ? Why? I don't know much about Gopanic, but just to get a sense of how it works. A lot has been deleted for this article

Golang Performance Optimization Analysis Tool PPROF (Part 1)

Memory: Application CPU usage - length of use, percentage, memory leaks, etc. If you look at the heap and stack usage in the previous section, this is some of the performance tuning in golang. For example, CPU performance debugging in Linux, the tools are TOP, dstat, perf and so on. Here is pprof, golang worker...

Gin returns JSON data - refactor | Go Theme month

Gin catch exceptions, encapsulation middleware return custom formatting data | Go theme on an exception is thrown by panic, through the way of recovery capture back in to see the Go - advice found panic

Handling mistakes gracefully is such an art.

Errors, you must have used the standard library errors implementation is relatively simple, cannot be stack trace, is not very friendly to the upper level of the caller when the error is generated, can not get the error call chain details.

About (Moment For Technology) is a global community with thousands techies from across the global hang out!Passionate technologists, be it gadget freaks, tech enthusiasts, coders, technopreneurs, or CIOs, you would find them all here.