Browse Source

fmt update

Fix: Placed all +build tags in the same location
Fix: Split CFLAGS, LDFLAGS into seperate lines for readability and lookup
Fix: Placed empty line between copyright comments and build tags for readability
Fix: Placed OS specfic cgo flags at the end if the cgo sections contains multiple lines.
Gert-Jan Timmer 1 year ago
parent
commit
420bfbcac8

+ 9 - 5
sqlite3.go

@@ -1,23 +1,27 @@
-// +build cgo
-
 // Copyright (C) 2014 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+// +build cgo
+
 package sqlite3
 
 /*
 #cgo CFLAGS: -std=gnu99
-#cgo CFLAGS: -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DHAVE_USLEEP=1
-#cgo linux,!android CFLAGS: -DHAVE_PREAD64=1 -DHAVE_PWRITE64=1
-#cgo CFLAGS: -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61
+#cgo CFLAGS: -DSQLITE_ENABLE_RTREE
+#cgo CFLAGS: -DSQLITE_THREADSAFE=1
+#cgo CFLAGS: -DHAVE_USLEEP=1
+#cgo CFLAGS: -DSQLITE_ENABLE_FTS3
+#cgo CFLAGS: -DSQLITE_ENABLE_FTS3_PARENTHESIS
+#cgo CFLAGS: -DSQLITE_ENABLE_FTS4_UNICODE61
 #cgo CFLAGS: -DSQLITE_TRACE_SIZE_LIMIT=15
 #cgo CFLAGS: -DSQLITE_OMIT_DEPRECATED
 #cgo CFLAGS: -DSQLITE_DISABLE_INTRINSIC
 #cgo CFLAGS: -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1
 #cgo CFLAGS: -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
 #cgo CFLAGS: -Wno-deprecated-declarations
+#cgo linux,!android CFLAGS: -DHAVE_PREAD64=1 -DHAVE_PWRITE64=1
 #ifndef USE_LIBSQLITE3
 #include <sqlite3-binding.h>
 #else

+ 1 - 2
sqlite3_go18.go

@@ -1,10 +1,9 @@
-// +build cgo
-
 // Copyright (C) 2014 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+// +build cgo
 // +build go1.8
 
 package sqlite3

+ 1 - 0
sqlite3_libsqlite3.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build libsqlite3
 
 package sqlite3

+ 1 - 0
sqlite3_load_extension.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build !sqlite_omit_load_extension
 
 package sqlite3

+ 1 - 0
sqlite3_omit_load_extension.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_omit_load_extension
 
 package sqlite3

+ 1 - 0
sqlite3_opt_allow_uri_authority.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_allow_uri_authority
 
 package sqlite3

+ 1 - 0
sqlite3_opt_app_armor.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build !windows
 // +build sqlite_app_armor
 

+ 1 - 0
sqlite3_opt_foreign_keys.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_foreign_keys
 
 package sqlite3

+ 1 - 0
sqlite3_opt_fts5.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_fts5 fts5
 
 package sqlite3

+ 1 - 0
sqlite3_opt_icu.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_icu icu
 
 package sqlite3

+ 1 - 0
sqlite3_opt_introspect.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_introspect
 
 package sqlite3

+ 1 - 0
sqlite3_opt_json1.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_json sqlite_json1 json1
 
 package sqlite3

+ 1 - 0
sqlite3_opt_secure_delete.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_secure_delete
 
 package sqlite3

+ 1 - 0
sqlite3_opt_stat4.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_stat4
 
 package sqlite3

+ 1 - 0
sqlite3_opt_vacuum_full.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_vacuum_full
 
 package sqlite3

+ 1 - 0
sqlite3_opt_vacuum_incr.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_vacuum_incr
 
 package sqlite3

+ 6 - 2
sqlite3_opt_vtable.go

@@ -2,14 +2,18 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_vtable vtable
 
 package sqlite3
 
 /*
 #cgo CFLAGS: -std=gnu99
-#cgo CFLAGS: -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE
-#cgo CFLAGS: -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61
+#cgo CFLAGS: -DSQLITE_ENABLE_RTREE
+#cgo CFLAGS: -DSQLITE_THREADSAFE
+#cgo CFLAGS: -DSQLITE_ENABLE_FTS3
+#cgo CFLAGS: -DSQLITE_ENABLE_FTS3_PARENTHESIS
+#cgo CFLAGS: -DSQLITE_ENABLE_FTS4_UNICODE61
 #cgo CFLAGS: -DSQLITE_TRACE_SIZE_LIMIT=15
 #cgo CFLAGS: -DSQLITE_ENABLE_COLUMN_METADATA=1
 #cgo CFLAGS: -Wno-deprecated-declarations

+ 1 - 0
sqlite3_opt_vtable_test.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_vtable vtable
 
 package sqlite3

+ 1 - 0
sqlite3_other.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build !windows
 
 package sqlite3

+ 1 - 0
sqlite3_solaris.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build solaris
 
 package sqlite3

+ 1 - 0
sqlite3_trace.go

@@ -2,6 +2,7 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build sqlite_trace trace
 
 package sqlite3

+ 2 - 2
sqlite3_usleep_windows.go

@@ -1,10 +1,10 @@
-// +build cgo
-
 // Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+// +build cgo
+
 package sqlite3
 
 // usleep is a function available on *nix based systems.

+ 6 - 2
sqlite3_windows.go

@@ -2,13 +2,17 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
+
 // +build windows
 
 package sqlite3
 
 /*
-#cgo CFLAGS: -I. -fno-stack-check -fno-stack-protector -mno-stack-arg-probe
-#cgo windows,386 CFLAGS: -D_USE_32BIT_TIME_T
+#cgo CFLAGS: -I.
+#cgo CFLAGS: -fno-stack-check
+#cgo CFLAGS: -fno-stack-protector
+#cgo CFLAGS: -mno-stack-arg-probe
 #cgo LDFLAGS: -lmingwex -lmingw32
+#cgo windows,386 CFLAGS: -D_USE_32BIT_TIME_T
 */
 import "C"