Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 926eb54

Browse files
snippet(go): reformat & revise snippets for consistency
This pull request introduces consistent formatting changes to various Go code snippets in the 'go-mode' directory. The changes include: - Adding spaces between function parameters and return types. - Formatting import statements to use parentheses for multiple imports. - Updating struct snippets to include a name for the struct type. - Updating the 'switch' snippet to include an expression. - Adding `type` for creating a new struct or interface. **Changes Made:** - In 'go-mode/f' and 'go-mode/func', added spaces between function parameters and return types to follow go convention. - In 'go-mode/method', added spaces between function parameters and return types to follow go convention. - In 'go-mode/imp' and 'go-mode/import', reformatted import statements to use parentheses for multiple imports. - In 'go-mode/struct', added a name for the struct type for clarity. - Add a new file `go-mode/type` for creating a new struct or interface. - In 'go-mode/switch', updated the 'switch' snippet to include an expression for better usage.
1 parent bde10ea commit 926eb54

File tree

9 files changed

+19
-9
lines changed

9 files changed

+19
-9
lines changed

‎go-mode/f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- mode: snippet -*-
22
# name: func ...(...) ... { ... }
33
# --
4-
func ${1:name}(${2:args})${3:return type}{
4+
func ${1:name}(${2:args})${3:return type}{
55
`%`0ドル
66
}

‎go-mode/fm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- mode: snippet -*-
22
# name: func (target) name(args) (results) { ... }
33
# --
4-
func (${1:target}) ${2:name}(${3:args})${4:return type}{
4+
func (${1:target}) ${2:name}(${3:args})${4:return type}{
55
0ドル
66
}

‎go-mode/func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- mode: snippet -*-
22
# name: func ...(...) ... { ... }
33
# --
4-
func ${1:name}(${2:args})${3:return type}{
4+
func ${1:name}(${2:args})${3:return type}{
55
`%`0ドル
66
}

‎go-mode/imp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# -*- mode: snippet -*-
22
# name: import
33
# --
4-
import ${1:package}0ドル
4+
import (
5+
${1:package}0ドル
6+
)

‎go-mode/import

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# -*- mode: snippet -*-
22
# name: import
33
# --
4-
import ${1:package}0ドル
4+
import (
5+
${1:package}0ドル
6+
)

‎go-mode/method

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- mode: snippet -*-
22
# name: func (target) name(args) (results) { ... }
33
# --
4-
func (${1:target}) ${2:name}(${3:args})${4:return type}{
4+
func (${1:target}) ${2:name}(${3:args})${4:return type}{
55
0ドル
66
}

‎go-mode/struct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- mode: snippet -*-
22
# name: type ... struct { ... }
33
# --
4-
type $1 struct {
4+
type ${1:name} struct {
55
`%`0ドル
66
}

‎go-mode/switch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# key: switch
44
# uuid: switch
55
# --
6-
switch {
7-
case ${1:cond}:
6+
switch ${1:express}{
7+
case ${2:cond}:
88
0ドル
99
}

‎go-mode/type

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -*- mode: snippet -*-
2+
# name: type ... ... { ... }
3+
# --
4+
type ${1:name} ${2:struct | interface} {
5+
`%`0ドル
6+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /