Skip to content

Commit 420bfbc

Browse files
committed
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.
1 parent b8b158d commit 420bfbc

23 files changed

+42
-13
lines changed

sqlite3.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
// +build cgo
2-
31
// Copyright (C) 2014 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
42
//
53
// Use of this source code is governed by an MIT-style
64
// license that can be found in the LICENSE file.
75

6+
// +build cgo
7+
88
package sqlite3
99

1010
/*
1111
#cgo CFLAGS: -std=gnu99
12-
#cgo CFLAGS: -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DHAVE_USLEEP=1
13-
#cgo linux,!android CFLAGS: -DHAVE_PREAD64=1 -DHAVE_PWRITE64=1
14-
#cgo CFLAGS: -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61
12+
#cgo CFLAGS: -DSQLITE_ENABLE_RTREE
13+
#cgo CFLAGS: -DSQLITE_THREADSAFE=1
14+
#cgo CFLAGS: -DHAVE_USLEEP=1
15+
#cgo CFLAGS: -DSQLITE_ENABLE_FTS3
16+
#cgo CFLAGS: -DSQLITE_ENABLE_FTS3_PARENTHESIS
17+
#cgo CFLAGS: -DSQLITE_ENABLE_FTS4_UNICODE61
1518
#cgo CFLAGS: -DSQLITE_TRACE_SIZE_LIMIT=15
1619
#cgo CFLAGS: -DSQLITE_OMIT_DEPRECATED
1720
#cgo CFLAGS: -DSQLITE_DISABLE_INTRINSIC
1821
#cgo CFLAGS: -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1
1922
#cgo CFLAGS: -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
2023
#cgo CFLAGS: -Wno-deprecated-declarations
24+
#cgo linux,!android CFLAGS: -DHAVE_PREAD64=1 -DHAVE_PWRITE64=1
2125
#ifndef USE_LIBSQLITE3
2226
#include <sqlite3-binding.h>
2327
#else

sqlite3_go18.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// +build cgo
2-
31
// Copyright (C) 2014 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
42
//
53
// Use of this source code is governed by an MIT-style
64
// license that can be found in the LICENSE file.
75

6+
// +build cgo
87
// +build go1.8
98

109
package sqlite3

sqlite3_libsqlite3.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build libsqlite3
67

78
package sqlite3

sqlite3_load_extension.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build !sqlite_omit_load_extension
67

78
package sqlite3

sqlite3_omit_load_extension.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_omit_load_extension
67

78
package sqlite3

sqlite3_opt_allow_uri_authority.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_allow_uri_authority
67

78
package sqlite3

sqlite3_opt_app_armor.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build !windows
67
// +build sqlite_app_armor
78

sqlite3_opt_foreign_keys.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_foreign_keys
67

78
package sqlite3

sqlite3_opt_fts5.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_fts5 fts5
67

78
package sqlite3

sqlite3_opt_icu.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_icu icu
67

78
package sqlite3

sqlite3_opt_introspect.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_introspect
67

78
package sqlite3

sqlite3_opt_json1.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_json sqlite_json1 json1
67

78
package sqlite3

sqlite3_opt_secure_delete.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_secure_delete
67

78
package sqlite3

sqlite3_opt_stat4.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_stat4
67

78
package sqlite3

sqlite3_opt_vacuum_full.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_vacuum_full
67

78
package sqlite3

sqlite3_opt_vacuum_incr.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_vacuum_incr
67

78
package sqlite3

sqlite3_opt_vtable.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_vtable vtable
67

78
package sqlite3
89

910
/*
1011
#cgo CFLAGS: -std=gnu99
11-
#cgo CFLAGS: -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE
12-
#cgo CFLAGS: -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61
12+
#cgo CFLAGS: -DSQLITE_ENABLE_RTREE
13+
#cgo CFLAGS: -DSQLITE_THREADSAFE
14+
#cgo CFLAGS: -DSQLITE_ENABLE_FTS3
15+
#cgo CFLAGS: -DSQLITE_ENABLE_FTS3_PARENTHESIS
16+
#cgo CFLAGS: -DSQLITE_ENABLE_FTS4_UNICODE61
1317
#cgo CFLAGS: -DSQLITE_TRACE_SIZE_LIMIT=15
1418
#cgo CFLAGS: -DSQLITE_ENABLE_COLUMN_METADATA=1
1519
#cgo CFLAGS: -Wno-deprecated-declarations

sqlite3_opt_vtable_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_vtable vtable
67

78
package sqlite3

sqlite3_other.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build !windows
67

78
package sqlite3

sqlite3_solaris.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build solaris
67

78
package sqlite3

sqlite3_trace.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build sqlite_trace trace
67

78
package sqlite3

sqlite3_usleep_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// +build cgo
2-
31
// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.
42
//
53
// Use of this source code is governed by an MIT-style
64
// license that can be found in the LICENSE file.
75

6+
// +build cgo
7+
88
package sqlite3
99

1010
// usleep is a function available on *nix based systems.

sqlite3_windows.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
5+
56
// +build windows
67

78
package sqlite3
89

910
/*
10-
#cgo CFLAGS: -I. -fno-stack-check -fno-stack-protector -mno-stack-arg-probe
11-
#cgo windows,386 CFLAGS: -D_USE_32BIT_TIME_T
11+
#cgo CFLAGS: -I.
12+
#cgo CFLAGS: -fno-stack-check
13+
#cgo CFLAGS: -fno-stack-protector
14+
#cgo CFLAGS: -mno-stack-arg-probe
1215
#cgo LDFLAGS: -lmingwex -lmingw32
16+
#cgo windows,386 CFLAGS: -D_USE_32BIT_TIME_T
1317
*/
1418
import "C"

0 commit comments

Comments
 (0)