In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "how to use go fmt commands in Go language". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to use go fmt commands in Go language".
Go fmt
Commands are mainly used to help you format the written code files [many third-party integration software uses go fmt commands]
First, use:
Go fmt .go
Using the gofmt command is more likely to use gofmt, and parameters are required
-w, otherwise the formatting result will not be written to the file. Gofmt-w src, which can format the entire project.
2. Introduction of parameters
-l displays files that need to be formatted
-w writes the rewritten content directly to the file, rather than printing it to standard output as a result.
-r add rewriting rules such as "a [b: len (a)]-> a [b:]" to facilitate us to do batch replacement.
-s simplify the code in the file
-d displays the diff before and after formatting instead of writing to the file. The default is false
-e prints all syntax errors to standard output. If you do not use this flag, only the first 10 errors of different lines will be printed.
-cpuprofile supports debug mode, and writes the corresponding cpufile to the specified file area.
The above is all the contents of the article "how to use go fmt commands in Go language". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.