Home > Backend Development > Golang > What are the disadvantages of go language

What are the disadvantages of go language

王林
Release: 2023-01-13 00:21:46
Original
8023 people have browsed it

Disadvantages of go language: 1. Lack of framework; 2. Go language simply returns errors through functions and expected call codes, easily losing the scope of error occurrence; 3. There is no way to formulate package management in go language Specific versions of dependent libraries.

What are the disadvantages of go language

The operating environment of this article: windows10 system, Go 1.11.2, thinkpad t480 computer.

Disadvantage 1: Lack of framework

The Go language does not have a major framework, such as Ruby's Rails framework, Python's Django framework, or PHP's Laravel. This is a hotly debated issue in the Go community, as many believe we shouldn't start with frameworks. This is true in many case scenarios, but if you just want to build a simple CRUD API, it will be much simpler to use Django/DJRF, Rails Laravel or Phoenix.

Disadvantage 2: Error handling

The Go language helps developers handle compilation errors by simply returning an error (or returning the call stack) through the function and the expected calling code. While this approach is effective, it is easy to lose the scope in which the error occurred, making it difficult to provide meaningful error information to the user. The errors package can solve this problem by allowing us to add context and stack traces for the returned errors.

Another problem is that we may forget to handle errors. Static analysis tools such as errcheck and megacheck can avoid these mistakes. While these solutions are effective, they may not be the right approach.

Disadvantage 3: Software package management

Go language package management is definitely not perfect. By default, it has no way to specify versions of dependent libraries, nor to create overridable builds. In comparison, Python, Node, and Ruby all have better package management systems. However, with the right tools, Go language package management can also perform well.

We can use Dep to manage dependencies, and it can also specify specific package versions. In addition, we can also use an open source tool called VirtualGo, which can easily manage multiple projects written in Go language.

Related recommendations: golang tutorial

The above is the detailed content of What are the disadvantages of go language. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template