From 420bfbcac8d3bc377e325ca78ecc73c192a7b03f Mon Sep 17 00:00:00 2001 From: Gert-Jan Timmer Date: Sun, 27 May 2018 00:05:45 +0200 Subject: [PATCH] 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. --- sqlite3.go | 14 +++++++++----- sqlite3_go18.go | 3 +-- sqlite3_libsqlite3.go | 1 + sqlite3_load_extension.go | 1 + sqlite3_omit_load_extension.go | 1 + sqlite3_opt_allow_uri_authority.go | 1 + sqlite3_opt_app_armor.go | 1 + sqlite3_opt_foreign_keys.go | 1 + sqlite3_opt_fts5.go | 1 + sqlite3_opt_icu.go | 1 + sqlite3_opt_introspect.go | 1 + sqlite3_opt_json1.go | 1 + sqlite3_opt_secure_delete.go | 1 + sqlite3_opt_stat4.go | 1 + sqlite3_opt_vacuum_full.go | 1 + sqlite3_opt_vacuum_incr.go | 1 + sqlite3_opt_vtable.go | 8 ++++++-- sqlite3_opt_vtable_test.go | 1 + sqlite3_other.go | 1 + sqlite3_solaris.go | 1 + sqlite3_trace.go | 1 + sqlite3_usleep_windows.go | 4 ++-- sqlite3_windows.go | 8 ++++++-- 23 files changed, 42 insertions(+), 13 deletions(-) diff --git a/sqlite3.go b/sqlite3.go index 7b9df9f..da464e2 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -1,23 +1,27 @@ -// +build cgo - // Copyright (C) 2014 Yasuhiro Matsumoto . // // 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 #else diff --git a/sqlite3_go18.go b/sqlite3_go18.go index dd0f5a7..43e6418 100644 --- a/sqlite3_go18.go +++ b/sqlite3_go18.go @@ -1,10 +1,9 @@ -// +build cgo - // Copyright (C) 2014 Yasuhiro Matsumoto . // // 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 diff --git a/sqlite3_libsqlite3.go b/sqlite3_libsqlite3.go index e4557e6..83c2ad9 100644 --- a/sqlite3_libsqlite3.go +++ b/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 diff --git a/sqlite3_load_extension.go b/sqlite3_load_extension.go index bb7e25f..e73982a 100644 --- a/sqlite3_load_extension.go +++ b/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 diff --git a/sqlite3_omit_load_extension.go b/sqlite3_omit_load_extension.go index c7b3bfe..7ea3294 100644 --- a/sqlite3_omit_load_extension.go +++ b/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 diff --git a/sqlite3_opt_allow_uri_authority.go b/sqlite3_opt_allow_uri_authority.go index 2a5c497..0b0ccde 100644 --- a/sqlite3_opt_allow_uri_authority.go +++ b/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 diff --git a/sqlite3_opt_app_armor.go b/sqlite3_opt_app_armor.go index 7108c5d..c395293 100644 --- a/sqlite3_opt_app_armor.go +++ b/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 diff --git a/sqlite3_opt_foreign_keys.go b/sqlite3_opt_foreign_keys.go index 882a1cd..fd6d97d 100644 --- a/sqlite3_opt_foreign_keys.go +++ b/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 diff --git a/sqlite3_opt_fts5.go b/sqlite3_opt_fts5.go index 9126272..fa98400 100644 --- a/sqlite3_opt_fts5.go +++ b/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 diff --git a/sqlite3_opt_icu.go b/sqlite3_opt_icu.go index 9bc0c61..32a1336 100644 --- a/sqlite3_opt_icu.go +++ b/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 diff --git a/sqlite3_opt_introspect.go b/sqlite3_opt_introspect.go index 19fd3ee..7819898 100644 --- a/sqlite3_opt_introspect.go +++ b/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 diff --git a/sqlite3_opt_json1.go b/sqlite3_opt_json1.go index 993f037..47d3599 100644 --- a/sqlite3_opt_json1.go +++ b/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 diff --git a/sqlite3_opt_secure_delete.go b/sqlite3_opt_secure_delete.go index 0ea5594..d243297 100644 --- a/sqlite3_opt_secure_delete.go +++ b/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 diff --git a/sqlite3_opt_stat4.go b/sqlite3_opt_stat4.go index 706cb87..37908fd 100644 --- a/sqlite3_opt_stat4.go +++ b/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 diff --git a/sqlite3_opt_vacuum_full.go b/sqlite3_opt_vacuum_full.go index 7217f95..3065931 100644 --- a/sqlite3_opt_vacuum_full.go +++ b/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 diff --git a/sqlite3_opt_vacuum_incr.go b/sqlite3_opt_vacuum_incr.go index 8dccc43..2f51f09 100644 --- a/sqlite3_opt_vacuum_incr.go +++ b/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 diff --git a/sqlite3_opt_vtable.go b/sqlite3_opt_vtable.go index 3391756..73d66c0 100644 --- a/sqlite3_opt_vtable.go +++ b/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 diff --git a/sqlite3_opt_vtable_test.go b/sqlite3_opt_vtable_test.go index 51dcd0f..d196c75 100644 --- a/sqlite3_opt_vtable_test.go +++ b/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 diff --git a/sqlite3_other.go b/sqlite3_other.go index f721b5e..b09f48e 100644 --- a/sqlite3_other.go +++ b/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 diff --git a/sqlite3_solaris.go b/sqlite3_solaris.go index dbbdf75..ea41c66 100644 --- a/sqlite3_solaris.go +++ b/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 diff --git a/sqlite3_trace.go b/sqlite3_trace.go index 999ba78..ee93a0f 100644 --- a/sqlite3_trace.go +++ b/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 diff --git a/sqlite3_usleep_windows.go b/sqlite3_usleep_windows.go index d439b53..1971a48 100644 --- a/sqlite3_usleep_windows.go +++ b/sqlite3_usleep_windows.go @@ -1,10 +1,10 @@ -// +build cgo - // Copyright (C) 2018 G.J.R. Timmer . // // 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. diff --git a/sqlite3_windows.go b/sqlite3_windows.go index 163e8f7..4222e7f 100644 --- a/sqlite3_windows.go +++ b/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"