Skip to content

Commit 2cb4e89

Browse files
committed
Cleanup with golint
Former-commit-id: 2d318c9
1 parent ad6c246 commit 2cb4e89

File tree

10 files changed

+28
-17
lines changed

10 files changed

+28
-17
lines changed

column.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ import "github.com/joncrlsn/pgutil"
1515
import "github.com/joncrlsn/misc"
1616

1717
// ==================================
18-
// ColumnRows definition (a sortable slice of string maps)
18+
// Column Rows definition
1919
// ==================================
20+
21+
// ColumnRows is a sortable slice of string maps
2022
type ColumnRows []map[string]string
2123

2224
func (slice ColumnRows) Len() int {

foreignkey.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ import "database/sql"
1212
import "github.com/joncrlsn/pgutil"
1313
import "github.com/joncrlsn/misc"
1414

15-
// ==================================
16-
// ForeignKeyRows definition
17-
// ==================================
15+
// ForeignKeyRows is a sortable string map
1816
type ForeignKeyRows []map[string]string
1917

2018
func (slice ForeignKeyRows) Len() int {

grant-attribute.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import "github.com/joncrlsn/pgutil"
1414
import "github.com/joncrlsn/misc"
1515

1616
// ==================================
17-
// GrantAttributeRows definition (an array of string maps)
17+
// GrantAttributeRows definition
1818
// ==================================
19+
20+
// GrantAttributeRows is a sortable slice of string maps
1921
type GrantAttributeRows []map[string]string
2022

2123
func (slice GrantAttributeRows) Len() int {
@@ -140,7 +142,7 @@ func (c *GrantAttributeSchema) Change(obj interface{}) {
140142

141143
// Find grants in the first db that are not in the second
142144
// (for this relationship and owner)
143-
grantList := make([]string, 0)
145+
var grantList []string
144146
for _, g := range grants1 {
145147
if !misc.ContainsString(grants2, g) {
146148
grantList = append(grantList, g)
@@ -152,7 +154,7 @@ func (c *GrantAttributeSchema) Change(obj interface{}) {
152154

153155
// Find grants in the second db that are not in the first
154156
// (for this relationship and owner)
155-
revokeList := make([]string, 0)
157+
var revokeList []string
156158
for _, g := range grants2 {
157159
if !misc.ContainsString(grants1, g) {
158160
revokeList = append(revokeList, g)

grant-relationship.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import "github.com/joncrlsn/pgutil"
1414
import "github.com/joncrlsn/misc"
1515

1616
// ==================================
17-
// GrantRelationshipRows definition (an array of string maps)
17+
// GrantRelationshipRows definition
1818
// ==================================
19+
20+
// GrantRelationshipRows is a sortable slice of string maps
1921
type GrantRelationshipRows []map[string]string
2022

2123
func (slice GrantRelationshipRows) Len() int {
@@ -133,7 +135,7 @@ func (c *GrantRelationshipSchema) Change(obj interface{}) {
133135

134136
// Find grants in the first db that are not in the second
135137
// (for this relationship and owner)
136-
grantList := make([]string, 0)
138+
var grantList []string
137139
for _, g := range grants1 {
138140
if !misc.ContainsString(grants2, g) {
139141
grantList = append(grantList, g)
@@ -145,7 +147,7 @@ func (c *GrantRelationshipSchema) Change(obj interface{}) {
145147

146148
// Find grants in the second db that are not in the first
147149
// (for this relationship and owner)
148-
revokeList := make([]string, 0)
150+
var revokeList []string
149151
for _, g := range grants2 {
150152
if !misc.ContainsString(grants1, g) {
151153
revokeList = append(revokeList, g)

grant.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import "regexp"
1515

1616
var aclRegex = regexp.MustCompile(`([a-zA-Z0-9]+)*=([rwadDxtXUCcT]+)/([a-zA-Z0-9]+)$`)
1717

18-
var permMap map[string]string = map[string]string{
18+
var permMap = map[string]string{
1919
"a": "INSERT",
2020
"r": "SELECT",
2121
"w": "UPDATE",

index.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import "github.com/joncrlsn/pgutil"
1515
// ==================================
1616
// IndexRows definition
1717
// ==================================
18+
19+
// IndexRows is a sortable slice of string maps
1820
type IndexRows []map[string]string
1921

2022
func (slice IndexRows) Len() int {

owner.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import "github.com/joncrlsn/pgutil"
1313
import "github.com/joncrlsn/misc"
1414

1515
// ==================================
16-
// OwnerRows definition (an array of string maps)
16+
// OwnerRows definition
1717
// ==================================
18+
19+
// OwnerRows is a sortable slice of string maps
1820
type OwnerRows []map[string]string
1921

2022
func (slice OwnerRows) Len() int {

role.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ import "sort"
1212
import "github.com/joncrlsn/pgutil"
1313
import "github.com/joncrlsn/misc"
1414

15-
// ==================================
16-
// RoleRows definition (a sortable slice of string maps)
17-
// ==================================
15+
// RoleRows is a sortable slice of string maps
1816
type RoleRows []map[string]string
1917

2018
func (slice RoleRows) Len() int {
@@ -101,6 +99,7 @@ where option can be:
10199
| USER role_name [, ...]
102100
| SYSID uid
103101
*/
102+
104103
// Add generates SQL to add the constraint/index
105104
func (c RoleSchema) Add() {
106105
// We don't care about efficiency here so we just concat strings

sequence.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import "github.com/joncrlsn/pgutil"
1313
import "github.com/joncrlsn/misc"
1414

1515
// ==================================
16-
// SequenceRows definition (an slice of string maps)
16+
// SequenceRows definition
1717
// ==================================
18+
19+
// SequenceRows is a sortable slice of string maps
1820
type SequenceRows []map[string]string
1921

2022
func (slice SequenceRows) Len() int {

table.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import "github.com/joncrlsn/pgutil"
1313
import "github.com/joncrlsn/misc"
1414

1515
// ==================================
16-
// TableRows definition (a sortable slice of string maps)
16+
// TableRows definition
1717
// ==================================
18+
19+
// TableRows is a sortable slice of string maps
1820
type TableRows []map[string]string
1921

2022
func (slice TableRows) Len() int {

0 commit comments

Comments
 (0)