From 51ef4a20dce184e962e3593849d1b06317078424 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Thu, 7 Sep 2023 14:23:33 +0800 Subject: [PATCH] docs: fix go_mode.md --- docs/conversions/go_code.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/conversions/go_code.md b/docs/conversions/go_code.md index aeb1a02ad..c0b49bb8a 100644 --- a/docs/conversions/go_code.md +++ b/docs/conversions/go_code.md @@ -103,12 +103,12 @@ v := make([]string, 0, 4) ```go // bad -var_s string = F() +var s string = F() func F() string { return "A" } // good -var_s = F() +var s = F() // Since F already explicitly returns a string type, we don't need to explicitly specify the type of _s // still of that type @@ -439,7 +439,7 @@ const ( // ErrUnknown - 0: An unknown error occurred. ErrUnknown Code = iota // ErrFatal - 1: An fatal error occurred. - Err Fatal + ErrFatal ) ``` @@ -495,7 +495,7 @@ package superman ### 3.1 Package Notes - Each package has one and only one package-level annotation. -- Package comments are uniformly commented with // in the format of `// Package package name package description`, for example: +- Package comments are uniformly commented with // in the format of `// Package package description`, for example: ```go // Package genericclioptions contains flags which can be added to you command, bound, completed, and produce @@ -757,7 +757,7 @@ defer fd. Close() - If only the first item (key) is needed, discard the second. ```go -for key := range keys { +for keyIndex := range keys { // normal code } ```