mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-07-06 21:10:46 +08:00
upgrade to use testfixtures v3 (#11904)
* upgrade to use testfixtures v3 * simplify logic * make vendor * update per @lunny * Update templates/repo/empty.tmpl * Update templates/repo/empty.tmpl Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
contrib/pr
go.modgo.sumintegrations
models
vendor
github.com
go-testfixtures/testfixtures/v3
.editorconfig.gitattributes.gitignore.goreleaser.yml.sample.envCHANGELOG.mdDockerfileLICENSEREADME.mdTaskfile.ymldocker-compose.ymldump.gogo.modgo.sumhelper.gojson.gomysql.gopostgresql.gosqlite.gosqlserver.gotestfixtures.gotime.go
mattn/go-sqlite3
.travis.ymlREADME.mdbackup.gocallback.goconvert.goerror.gosqlite3-binding.csqlite3-binding.hsqlite3.gosqlite3_context.gosqlite3_go18.gosqlite3_libsqlite3.gosqlite3_load_extension.gosqlite3_load_extension_omit.gosqlite3_opt_allow_uri_authority.gosqlite3_opt_app_armor.gosqlite3_opt_foreign_keys.gosqlite3_opt_fts5.gosqlite3_opt_icu.gosqlite3_opt_introspect.gosqlite3_opt_json1.gosqlite3_opt_preupdate.gosqlite3_opt_preupdate_hook.gosqlite3_opt_preupdate_omit.gosqlite3_opt_secure_delete.gosqlite3_opt_secure_delete_fast.gosqlite3_opt_stat4.gosqlite3_opt_unlock_notify.gosqlite3_opt_vacuum_full.gosqlite3_opt_vacuum_incr.gosqlite3_opt_vtable.gosqlite3_other.gosqlite3_solaris.gosqlite3_trace.gosqlite3_type.gosqlite3_windows.gosqlite3ext.hstatic_mock.go
spf13/pflag
gopkg.in
testfixtures.v2
.travis.ymlREADME.mdTaskfile.ymlappveyor.ymldeprecated.goerrors.gogenerate.gooptions.gooracle.gotestfixtures.gotime.go
yaml.v2
21
vendor/github.com/mattn/go-sqlite3/error.go
generated
vendored
21
vendor/github.com/mattn/go-sqlite3/error.go
generated
vendored
@ -1,11 +1,19 @@
|
||||
// Copyright (C) 2014 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
|
||||
// Copyright (C) 2019 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.
|
||||
|
||||
package sqlite3
|
||||
|
||||
/*
|
||||
#ifndef USE_LIBSQLITE3
|
||||
#include <sqlite3-binding.h>
|
||||
#else
|
||||
#include <sqlite3.h>
|
||||
#endif
|
||||
*/
|
||||
import "C"
|
||||
import "syscall"
|
||||
|
||||
// ErrNo inherit errno.
|
||||
type ErrNo int
|
||||
@ -20,6 +28,7 @@ type ErrNoExtended int
|
||||
type Error struct {
|
||||
Code ErrNo /* The error code returned by SQLite */
|
||||
ExtendedCode ErrNoExtended /* The extended error code returned by SQLite */
|
||||
SystemErrno syscall.Errno /* The system errno returned by the OS through SQLite, if applicable */
|
||||
err string /* The error string returned by sqlite3_errmsg(),
|
||||
this usually contains more specific details. */
|
||||
}
|
||||
@ -72,10 +81,16 @@ func (err ErrNoExtended) Error() string {
|
||||
}
|
||||
|
||||
func (err Error) Error() string {
|
||||
var str string
|
||||
if err.err != "" {
|
||||
return err.err
|
||||
str = err.err
|
||||
} else {
|
||||
str = C.GoString(C.sqlite3_errstr(C.int(err.Code)))
|
||||
}
|
||||
return errorString(err)
|
||||
if err.SystemErrno != 0 {
|
||||
str += ": " + err.SystemErrno.Error()
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
// result codes from http://www.sqlite.org/c3ref/c_abort_rollback.html
|
||||
|
Reference in New Issue
Block a user