Run of fresh-snapshots for golang-github-kisielk-sqlstruct

Merge these changes:

Summary

Merged new upstream version: 0.0~git20210630.1.dae28ed (was: 0.0~git20210630.0.dae28ed).

Diff

Branch: main

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0026861
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,22 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe
diff --git a/.travis.yml b/.travis.yml
index f6e4872..aba4c77 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,14 @@
+arch:
+  - amd64
+  - ppc64le
 language: go
 
 go:
   - 1.2
   - tip
+jobs:
+ exclude:
+  - go: 1.2
+    arch: ppc64le
+  - go: 1.2
+    arch: amd64
diff --git a/debian/changelog b/debian/changelog
index ecf1d79..15426e3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-golang-github-kisielk-sqlstruct (0.0~git20150917.0.0b86a3e-3) UNRELEASED; urgency=medium
+golang-github-kisielk-sqlstruct (0.0~git20210630.1.dae28ed-1) UNRELEASED; urgency=medium
 
   [ Alexandre Viau ]
   * Point Vcs-* urls to salsa.debian.org.
@@ -6,7 +6,11 @@ golang-github-kisielk-sqlstruct (0.0~git20150917.0.0b86a3e-3) UNRELEASED; urgenc
   [ Tianon Gravi ]
   * Remove self from Uploaders
 
- -- Alexandre Viau <aviau@debian.org>  Mon, 02 Apr 2018 18:34:08 -0400
+  [ Debian Janitor ]
+  * New upstream snapshot.
+  * New upstream snapshot.
+
+ -- Alexandre Viau <aviau@debian.org>  Sat, 09 Apr 2022 16:55:01 -0000
 
 golang-github-kisielk-sqlstruct (0.0~git20150917.0.0b86a3e-2) unstable; urgency=medium
 
diff --git a/sqlstruct.go b/sqlstruct.go
index e126af1..2fa727e 100644
--- a/sqlstruct.go
+++ b/sqlstruct.go
@@ -1,6 +1,6 @@
 // Copyright 2012 Kamil Kisiel. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
+// Use of this source code is governed by the MIT
+// license which can be found in the LICENSE file.
 
 /*
 Package sqlstruct provides some convenience functions for using structs with
@@ -52,10 +52,10 @@ by the same alias, using the ColumnsAliased and ScanAliased functions:
     var user User
     var address Address
     sql := `
-SELECT %s, %s FROM users AS u
-INNER JOIN address AS a ON a.id = u.address_id
-WHERE u.username = ?
-`
+    SELECT %s, %s FROM users AS u
+    INNER JOIN address AS a ON a.id = u.address_id
+    WHERE u.username = ?
+    `
     sql = fmt.Sprintf(sql, sqlstruct.ColumnsAliased(*user, "u"), sqlstruct.ColumnsAliased(*address, "a"))
     rows, err := db.Query(sql, "gedi")
     if err != nil {
@@ -91,18 +91,16 @@ import (
 	"sync"
 )
 
-// NameMapper is used to convert struct fields which do not have sql tags
-// into database column names. The default mapper is a no-op.
+// NameMapper is the function used to convert struct fields which do not have sql tags
+// into database column names.
 //
-// Example override usage:
+// The default mapper converts field names to lower case. If instead you would prefer
+// field names converted to snake case, simply assign sqlstruct.ToSnakeCase to the variable:
 //
-//  FirstName => first_name
 //		sqlstruct.NameMapper = sqlstruct.ToSnakeCase
 //
-//  Any func(string)string can be used
-//
-//
-var NameMapper = strings.ToLower
+// Alternatively for a custom mapping, any func(string) string can be used instead.
+var NameMapper func(string) string = strings.ToLower
 
 // A cache of fieldInfos to save reflecting every time. Inspried by encoding/xml
 var finfos map[reflect.Type]fieldInfo
@@ -260,6 +258,8 @@ func doScan(dest interface{}, rows Rows, alias string) error {
 	return rows.Scan(values...)
 }
 
+// ToSnakeCase converts a string to snake case, words separated with underscores.
+// It's intended to be used with NameMapper to map struct field names to snake case database fields.
 func ToSnakeCase(src string) string {
 	thisUpper := false
 	prevUpper := false
diff --git a/sqlstruct_test.go b/sqlstruct_test.go
index 0bd77f2..be6e940 100644
--- a/sqlstruct_test.go
+++ b/sqlstruct_test.go
@@ -1,6 +1,6 @@
 // Copyright 2012 Kamil Kisiel. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
+// Use of this source code is governed by the MIT
+// license which can be found in the LICENSE file.
 package sqlstruct
 
 import (

Branch: pristine-tar

diff --git a/golang-github-kisielk-sqlstruct_0.0~git20210630.1.dae28ed.orig.tar.gz.delta b/golang-github-kisielk-sqlstruct_0.0~git20210630.1.dae28ed.orig.tar.gz.delta
new file mode 100644
index 0000000..3f6b77a
Binary files /dev/null and b/golang-github-kisielk-sqlstruct_0.0~git20210630.1.dae28ed.orig.tar.gz.delta differ
diff --git a/golang-github-kisielk-sqlstruct_0.0~git20210630.1.dae28ed.orig.tar.gz.id b/golang-github-kisielk-sqlstruct_0.0~git20210630.1.dae28ed.orig.tar.gz.id
new file mode 100644
index 0000000..bf95022
--- /dev/null
+++ b/golang-github-kisielk-sqlstruct_0.0~git20210630.1.dae28ed.orig.tar.gz.id
@@ -0,0 +1 @@
+c0c5eb446ab7d103adf2b607062f25ce983c11ff

Branch: upstream

Tag: upstream/0.0_git20210630.1.dae28ed
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0026861
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,22 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe
diff --git a/.travis.yml b/.travis.yml
index f6e4872..aba4c77 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,14 @@
+arch:
+  - amd64
+  - ppc64le
 language: go
 
 go:
   - 1.2
   - tip
+jobs:
+ exclude:
+  - go: 1.2
+    arch: ppc64le
+  - go: 1.2
+    arch: amd64
diff --git a/sqlstruct.go b/sqlstruct.go
index e126af1..2fa727e 100644
--- a/sqlstruct.go
+++ b/sqlstruct.go
@@ -1,6 +1,6 @@
 // Copyright 2012 Kamil Kisiel. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
+// Use of this source code is governed by the MIT
+// license which can be found in the LICENSE file.
 
 /*
 Package sqlstruct provides some convenience functions for using structs with
@@ -52,10 +52,10 @@ by the same alias, using the ColumnsAliased and ScanAliased functions:
     var user User
     var address Address
     sql := `
-SELECT %s, %s FROM users AS u
-INNER JOIN address AS a ON a.id = u.address_id
-WHERE u.username = ?
-`
+    SELECT %s, %s FROM users AS u
+    INNER JOIN address AS a ON a.id = u.address_id
+    WHERE u.username = ?
+    `
     sql = fmt.Sprintf(sql, sqlstruct.ColumnsAliased(*user, "u"), sqlstruct.ColumnsAliased(*address, "a"))
     rows, err := db.Query(sql, "gedi")
     if err != nil {
@@ -91,18 +91,16 @@ import (
 	"sync"
 )
 
-// NameMapper is used to convert struct fields which do not have sql tags
-// into database column names. The default mapper is a no-op.
+// NameMapper is the function used to convert struct fields which do not have sql tags
+// into database column names.
 //
-// Example override usage:
+// The default mapper converts field names to lower case. If instead you would prefer
+// field names converted to snake case, simply assign sqlstruct.ToSnakeCase to the variable:
 //
-//  FirstName => first_name
 //		sqlstruct.NameMapper = sqlstruct.ToSnakeCase
 //
-//  Any func(string)string can be used
-//
-//
-var NameMapper = strings.ToLower
+// Alternatively for a custom mapping, any func(string) string can be used instead.
+var NameMapper func(string) string = strings.ToLower
 
 // A cache of fieldInfos to save reflecting every time. Inspried by encoding/xml
 var finfos map[reflect.Type]fieldInfo
@@ -260,6 +258,8 @@ func doScan(dest interface{}, rows Rows, alias string) error {
 	return rows.Scan(values...)
 }
 
+// ToSnakeCase converts a string to snake case, words separated with underscores.
+// It's intended to be used with NameMapper to map struct field names to snake case database fields.
 func ToSnakeCase(src string) string {
 	thisUpper := false
 	prevUpper := false
diff --git a/sqlstruct_test.go b/sqlstruct_test.go
index 0bd77f2..be6e940 100644
--- a/sqlstruct_test.go
+++ b/sqlstruct_test.go
@@ -1,6 +1,6 @@
 // Copyright 2012 Kamil Kisiel. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
+// Use of this source code is governed by the MIT
+// license which can be found in the LICENSE file.
 package sqlstruct
 
 import (

Publish Blockers

  • ☑ run was successful
  • ☑ package has not been removed from the archive
  • ☒ command changed from DEB_UPDATE_CHANGELOG=leave deb-new-upstream --snapshot --refresh-patches to DEB_UPDATE_CHANGELOG=auto deb-new-upstream --snapshot --refresh-patches
  • ☒ not yet reviewed, but review needed
  • ☑ 0 publish attempts so far. not currently attempting to back off
  • ☒ merge proposals for the package maintainer are currently being rate-limited (open: 1135, max open: 200)
  • ☑ change set 8b7b8786-13f4-4c88-ac6e-7f0305691450 is ready

Resulting package

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots golang-github-kisielk-sqlstruct-dev

Lintian Result

Full worker log Full build log