diff --git a/ql/test/library-tests/semmle/go/frameworks/Email/go.mod b/ql/test/library-tests/semmle/go/frameworks/Email/go.mod index d3b7fdb67f8..eb193e9905e 100644 --- a/ql/test/library-tests/semmle/go/frameworks/Email/go.mod +++ b/ql/test/library-tests/semmle/go/frameworks/Email/go.mod @@ -2,7 +2,4 @@ module main go 1.14 -require ( - github.com/sendgrid/sendgrid-go v3.5.0+incompatible - github.com/stretchr/testify v1.5.1 // indirect -) +require github.com/sendgrid/sendgrid-go v3.5.0+incompatible diff --git a/ql/test/library-tests/semmle/go/frameworks/Email/vendor/modules.txt b/ql/test/library-tests/semmle/go/frameworks/Email/vendor/modules.txt index d782a4cc242..4b7525957df 100644 --- a/ql/test/library-tests/semmle/go/frameworks/Email/vendor/modules.txt +++ b/ql/test/library-tests/semmle/go/frameworks/Email/vendor/modules.txt @@ -1,6 +1,3 @@ # github.com/sendgrid/sendgrid-go v3.5.0+incompatible ## explicit github.com/sendgrid/sendgrid-go -# github.com/stretchr/testify v1.5.1 -## explicit -github.com/stretchr/testify diff --git a/ql/test/library-tests/semmle/go/frameworks/NoSQL/vendor/go.mongodb.org/mongo-driver/mongo/stub.go b/ql/test/library-tests/semmle/go/frameworks/NoSQL/vendor/go.mongodb.org/mongo-driver/mongo/stub.go index 57fda704783..be1ed14fbaf 100644 --- a/ql/test/library-tests/semmle/go/frameworks/NoSQL/vendor/go.mongodb.org/mongo-driver/mongo/stub.go +++ b/ql/test/library-tests/semmle/go/frameworks/NoSQL/vendor/go.mongodb.org/mongo-driver/mongo/stub.go @@ -59,7 +59,7 @@ func (_ *Client) Connect(_ context.Context) error { return nil } -func (_ *Client) Database(_ string, _ ...*interface{}) *Database { +func (_ *Client) Database(_ string, _ ...interface{}) *Database { return nil } @@ -67,11 +67,11 @@ func (_ *Client) Disconnect(_ context.Context) error { return nil } -func (_ *Client) ListDatabaseNames(_ context.Context, _ interface{}, _ ...*interface{}) ([]string, error) { +func (_ *Client) ListDatabaseNames(_ context.Context, _ interface{}, _ ...interface{}) ([]string, error) { return nil, nil } -func (_ *Client) ListDatabases(_ context.Context, _ interface{}, _ ...*interface{}) (ListDatabasesResult, error) { +func (_ *Client) ListDatabases(_ context.Context, _ interface{}, _ ...interface{}) (ListDatabasesResult, error) { return ListDatabasesResult{}, nil } @@ -79,11 +79,11 @@ func (_ *Client) NumberSessionsInProgress() int { return 0 } -func (_ *Client) Ping(_ context.Context, _ *interface{}) error { +func (_ *Client) Ping(_ context.Context, _ interface{}) error { return nil } -func (_ *Client) StartSession(_ ...*interface{}) (Session, error) { +func (_ *Client) StartSession(_ ...interface{}) (Session, error) { return nil, nil } @@ -91,29 +91,29 @@ func (_ *Client) UseSession(_ context.Context, _ func(SessionContext) error) err return nil } -func (_ *Client) UseSessionWithOptions(_ context.Context, _ *interface{}, _ func(SessionContext) error) error { +func (_ *Client) UseSessionWithOptions(_ context.Context, _ interface{}, _ func(SessionContext) error) error { return nil } -func (_ *Client) Watch(_ context.Context, _ interface{}, _ ...*interface{}) (*ChangeStream, error) { +func (_ *Client) Watch(_ context.Context, _ interface{}, _ ...interface{}) (*ChangeStream, error) { return nil, nil } type Collection struct{} -func (_ *Collection) Aggregate(_ context.Context, _ interface{}, _ ...*interface{}) (*Cursor, error) { +func (_ *Collection) Aggregate(_ context.Context, _ interface{}, _ ...interface{}) (*Cursor, error) { return nil, nil } -func (_ *Collection) BulkWrite(_ context.Context, _ []WriteModel, _ ...*interface{}) (*BulkWriteResult, error) { +func (_ *Collection) BulkWrite(_ context.Context, _ []WriteModel, _ ...interface{}) (*BulkWriteResult, error) { return nil, nil } -func (_ *Collection) Clone(_ ...*interface{}) (*Collection, error) { +func (_ *Collection) Clone(_ ...interface{}) (*Collection, error) { return nil, nil } -func (_ *Collection) CountDocuments(_ context.Context, _ interface{}, _ ...*interface{}) (int64, error) { +func (_ *Collection) CountDocuments(_ context.Context, _ interface{}, _ ...interface{}) (int64, error) { return 0, nil } @@ -121,15 +121,15 @@ func (_ *Collection) Database() *Database { return nil } -func (_ *Collection) DeleteMany(_ context.Context, _ interface{}, _ ...*interface{}) (*DeleteResult, error) { +func (_ *Collection) DeleteMany(_ context.Context, _ interface{}, _ ...interface{}) (*DeleteResult, error) { return nil, nil } -func (_ *Collection) DeleteOne(_ context.Context, _ interface{}, _ ...*interface{}) (*DeleteResult, error) { +func (_ *Collection) DeleteOne(_ context.Context, _ interface{}, _ ...interface{}) (*DeleteResult, error) { return nil, nil } -func (_ *Collection) Distinct(_ context.Context, _ string, _ interface{}, _ ...*interface{}) ([]interface{}, error) { +func (_ *Collection) Distinct(_ context.Context, _ string, _ interface{}, _ ...interface{}) ([]interface{}, error) { return nil, nil } @@ -137,27 +137,27 @@ func (_ *Collection) Drop(_ context.Context) error { return nil } -func (_ *Collection) EstimatedDocumentCount(_ context.Context, _ ...*interface{}) (int64, error) { +func (_ *Collection) EstimatedDocumentCount(_ context.Context, _ ...interface{}) (int64, error) { return 0, nil } -func (_ *Collection) Find(_ context.Context, _ interface{}, _ ...*interface{}) (*Cursor, error) { +func (_ *Collection) Find(_ context.Context, _ interface{}, _ ...interface{}) (*Cursor, error) { return nil, nil } -func (_ *Collection) FindOne(_ context.Context, _ interface{}, _ ...*interface{}) *SingleResult { +func (_ *Collection) FindOne(_ context.Context, _ interface{}, _ ...interface{}) *SingleResult { return nil } -func (_ *Collection) FindOneAndDelete(_ context.Context, _ interface{}, _ ...*interface{}) *SingleResult { +func (_ *Collection) FindOneAndDelete(_ context.Context, _ interface{}, _ ...interface{}) *SingleResult { return nil } -func (_ *Collection) FindOneAndReplace(_ context.Context, _ interface{}, _ interface{}, _ ...*interface{}) *SingleResult { +func (_ *Collection) FindOneAndReplace(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) *SingleResult { return nil } -func (_ *Collection) FindOneAndUpdate(_ context.Context, _ interface{}, _ interface{}, _ ...*interface{}) *SingleResult { +func (_ *Collection) FindOneAndUpdate(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) *SingleResult { return nil } @@ -165,11 +165,11 @@ func (_ *Collection) Indexes() IndexView { return IndexView{} } -func (_ *Collection) InsertMany(_ context.Context, _ []interface{}, _ ...*interface{}) (*InsertManyResult, error) { +func (_ *Collection) InsertMany(_ context.Context, _ []interface{}, _ ...interface{}) (*InsertManyResult, error) { return nil, nil } -func (_ *Collection) InsertOne(_ context.Context, _ interface{}, _ ...*interface{}) (*InsertOneResult, error) { +func (_ *Collection) InsertOne(_ context.Context, _ interface{}, _ ...interface{}) (*InsertOneResult, error) { return nil, nil } @@ -177,19 +177,19 @@ func (_ *Collection) Name() string { return "" } -func (_ *Collection) ReplaceOne(_ context.Context, _ interface{}, _ interface{}, _ ...*interface{}) (*UpdateResult, error) { +func (_ *Collection) ReplaceOne(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (*UpdateResult, error) { return nil, nil } -func (_ *Collection) UpdateMany(_ context.Context, _ interface{}, _ interface{}, _ ...*interface{}) (*UpdateResult, error) { +func (_ *Collection) UpdateMany(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (*UpdateResult, error) { return nil, nil } -func (_ *Collection) UpdateOne(_ context.Context, _ interface{}, _ interface{}, _ ...*interface{}) (*UpdateResult, error) { +func (_ *Collection) UpdateOne(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (*UpdateResult, error) { return nil, nil } -func (_ *Collection) Watch(_ context.Context, _ interface{}, _ ...*interface{}) (*ChangeStream, error) { +func (_ *Collection) Watch(_ context.Context, _ interface{}, _ ...interface{}) (*ChangeStream, error) { return nil, nil } @@ -227,7 +227,7 @@ func (_ *Cursor) TryNext(_ context.Context) bool { type Database struct{} -func (_ *Database) Aggregate(_ context.Context, _ interface{}, _ ...*interface{}) (*Cursor, error) { +func (_ *Database) Aggregate(_ context.Context, _ interface{}, _ ...interface{}) (*Cursor, error) { return nil, nil } @@ -235,7 +235,7 @@ func (_ *Database) Client() *Client { return nil } -func (_ *Database) Collection(_ string, _ ...*interface{}) *Collection { +func (_ *Database) Collection(_ string, _ ...interface{}) *Collection { return nil } @@ -243,11 +243,11 @@ func (_ *Database) Drop(_ context.Context) error { return nil } -func (_ *Database) ListCollectionNames(_ context.Context, _ interface{}, _ ...*interface{}) ([]string, error) { +func (_ *Database) ListCollectionNames(_ context.Context, _ interface{}, _ ...interface{}) ([]string, error) { return nil, nil } -func (_ *Database) ListCollections(_ context.Context, _ interface{}, _ ...*interface{}) (*Cursor, error) { +func (_ *Database) ListCollections(_ context.Context, _ interface{}, _ ...interface{}) (*Cursor, error) { return nil, nil } @@ -255,27 +255,27 @@ func (_ *Database) Name() string { return "" } -func (_ *Database) ReadConcern() *interface{} { +func (_ *Database) ReadConcern() interface{} { return nil } -func (_ *Database) ReadPreference() *interface{} { +func (_ *Database) ReadPreference() interface{} { return nil } -func (_ *Database) RunCommand(_ context.Context, _ interface{}, _ ...*interface{}) *SingleResult { +func (_ *Database) RunCommand(_ context.Context, _ interface{}, _ ...interface{}) *SingleResult { return nil } -func (_ *Database) RunCommandCursor(_ context.Context, _ interface{}, _ ...*interface{}) (*Cursor, error) { +func (_ *Database) RunCommandCursor(_ context.Context, _ interface{}, _ ...interface{}) (*Cursor, error) { return nil, nil } -func (_ *Database) Watch(_ context.Context, _ interface{}, _ ...*interface{}) (*ChangeStream, error) { +func (_ *Database) Watch(_ context.Context, _ interface{}, _ ...interface{}) (*ChangeStream, error) { return nil, nil } -func (_ *Database) WriteConcern() *interface{} { +func (_ *Database) WriteConcern() interface{} { return nil } @@ -291,28 +291,28 @@ type DeleteResult struct { type IndexModel struct { Keys interface{} - Options *interface{} + Options interface{} } type IndexView struct{} -func (_ IndexView) CreateMany(_ context.Context, _ []IndexModel, _ ...*interface{}) ([]string, error) { +func (_ IndexView) CreateMany(_ context.Context, _ []IndexModel, _ ...interface{}) ([]string, error) { return nil, nil } -func (_ IndexView) CreateOne(_ context.Context, _ IndexModel, _ ...*interface{}) (string, error) { +func (_ IndexView) CreateOne(_ context.Context, _ IndexModel, _ ...interface{}) (string, error) { return "", nil } -func (_ IndexView) DropAll(_ context.Context, _ ...*interface{}) (interface{}, error) { +func (_ IndexView) DropAll(_ context.Context, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ IndexView) DropOne(_ context.Context, _ string, _ ...*interface{}) (interface{}, error) { +func (_ IndexView) DropOne(_ context.Context, _ string, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ IndexView) List(_ context.Context, _ ...*interface{}) (*Cursor, error) { +func (_ IndexView) List(_ context.Context, _ ...interface{}) (*Cursor, error) { return nil, nil } @@ -334,20 +334,20 @@ type Pipeline []interface{} type Session interface { AbortTransaction(_ context.Context) error AdvanceClusterTime(_ interface{}) error - AdvanceOperationTime(_ *interface{}) error + AdvanceOperationTime(_ interface{}) error Client() *Client ClusterTime() interface{} CommitTransaction(_ context.Context) error EndSession(_ context.Context) - OperationTime() *interface{} - StartTransaction(_ ...*interface{}) error - WithTransaction(_ context.Context, _ func(SessionContext) (interface{}, error), _ ...*interface{}) (interface{}, error) + OperationTime() interface{} + StartTransaction(_ ...interface{}) error + WithTransaction(_ context.Context, _ func(SessionContext) (interface{}, error), _ ...interface{}) (interface{}, error) } type SessionContext interface { AbortTransaction(_ context.Context) error AdvanceClusterTime(_ interface{}) error - AdvanceOperationTime(_ *interface{}) error + AdvanceOperationTime(_ interface{}) error Client() *Client ClusterTime() interface{} CommitTransaction(_ context.Context) error @@ -355,10 +355,10 @@ type SessionContext interface { Done() <-chan struct{} EndSession(_ context.Context) Err() error - OperationTime() *interface{} - StartTransaction(_ ...*interface{}) error + OperationTime() interface{} + StartTransaction(_ ...interface{}) error Value(_ interface{}) interface{} - WithTransaction(_ context.Context, _ func(SessionContext) (interface{}, error), _ ...*interface{}) (interface{}, error) + WithTransaction(_ context.Context, _ func(SessionContext) (interface{}, error), _ ...interface{}) (interface{}, error) } type SingleResult struct{} diff --git a/ql/test/library-tests/semmle/go/frameworks/SQL/go.mod b/ql/test/library-tests/semmle/go/frameworks/SQL/go.mod index 14ee2e225ee..23bb420b262 100644 --- a/ql/test/library-tests/semmle/go/frameworks/SQL/go.mod +++ b/ql/test/library-tests/semmle/go/frameworks/SQL/go.mod @@ -4,11 +4,6 @@ go 1.13 require ( github.com/Masterminds/squirrel v1.1.0 - github.com/github/depstubber v0.0.0-20200414033246-a63ca77a1581 // indirect github.com/go-pg/pg v8.0.6+incompatible github.com/go-pg/pg/v9 v9.1.3 - github.com/go-sql-driver/mysql v1.5.0 // indirect - github.com/lib/pq v1.3.0 // indirect - github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect - golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect ) diff --git a/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/Masterminds/squirrel/stub.go b/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/Masterminds/squirrel/stub.go index 19d94461f3a..fc639e9e209 100644 --- a/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/Masterminds/squirrel/stub.go +++ b/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/Masterminds/squirrel/stub.go @@ -13,12 +13,8 @@ import ( ) type BaseRunner interface { - Exec(_ string, _ ...interface{}) (sql.Result, interface { - Error() string - }) - Query(_ string, _ ...interface{}) (*sql.Rows, interface { - Error() string - }) + Exec(_ string, _ ...interface{}) (sql.Result, error) + Query(_ string, _ ...interface{}) (*sql.Rows, error) } func Expr(_ string, _ ...interface{}) interface{} { @@ -26,15 +22,11 @@ func Expr(_ string, _ ...interface{}) interface{} { } type PlaceholderFormat interface { - ReplacePlaceholders(_ string) (string, interface { - Error() string - }) + ReplacePlaceholders(_ string) (string, error) } type RowScanner interface { - Scan(_ ...interface{}) interface { - Error() string - } + Scan(_ ...interface{}) error } func Select(_ ...string) SelectBuilder { @@ -55,15 +47,11 @@ func (_ SelectBuilder) Distinct() SelectBuilder { return SelectBuilder{} } -func (_ SelectBuilder) Exec() (sql.Result, interface { - Error() string -}) { +func (_ SelectBuilder) Exec() (sql.Result, error) { return nil, nil } -func (_ SelectBuilder) ExecContext(_ context.Context) (sql.Result, interface { - Error() string -}) { +func (_ SelectBuilder) ExecContext(_ context.Context) (sql.Result, error) { return nil, nil } @@ -123,15 +111,11 @@ func (_ SelectBuilder) Prefix(_ string, _ ...interface{}) SelectBuilder { return SelectBuilder{} } -func (_ SelectBuilder) Query() (*sql.Rows, interface { - Error() string -}) { +func (_ SelectBuilder) Query() (*sql.Rows, error) { return nil, nil } -func (_ SelectBuilder) QueryContext(_ context.Context) (*sql.Rows, interface { - Error() string -}) { +func (_ SelectBuilder) QueryContext(_ context.Context) (*sql.Rows, error) { return nil, nil } @@ -155,15 +139,11 @@ func (_ SelectBuilder) RunWith(_ BaseRunner) SelectBuilder { return SelectBuilder{} } -func (_ SelectBuilder) Scan(_ ...interface{}) interface { - Error() string -} { +func (_ SelectBuilder) Scan(_ ...interface{}) error { return nil } -func (_ SelectBuilder) ScanContext(_ context.Context, _ ...interface{}) interface { - Error() string -} { +func (_ SelectBuilder) ScanContext(_ context.Context, _ ...interface{}) error { return nil } @@ -171,9 +151,7 @@ func (_ SelectBuilder) Suffix(_ string, _ ...interface{}) SelectBuilder { return SelectBuilder{} } -func (_ SelectBuilder) ToSql() (string, []interface{}, interface { - Error() string -}) { +func (_ SelectBuilder) ToSql() (string, []interface{}, error) { return "", nil, nil } diff --git a/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/orm/stub.go b/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/orm/stub.go index 15d5f583e6a..b4cedc671bf 100644 --- a/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/orm/stub.go +++ b/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/orm/stub.go @@ -14,9 +14,7 @@ import ( ) type ColumnScanner interface { - ScanColumn(_ int, _ string, _ interface{}, _ int) interface { - Error() string - } + ScanColumn(_ int, _ string, _ interface{}, _ int) error } type CreateTableOptions struct { @@ -28,54 +26,24 @@ type CreateTableOptions struct { type DB interface { Context() context.Context - CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (Result, interface { - Error() string - }) - CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (Result, interface { - Error() string - }) - Delete(_ interface{}) interface { - Error() string - } - Exec(_ interface{}, _ ...interface{}) (Result, interface { - Error() string - }) - ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (Result, interface { - Error() string - }) - ExecOne(_ interface{}, _ ...interface{}) (Result, interface { - Error() string - }) - ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (Result, interface { - Error() string - }) - ForceDelete(_ interface{}) interface { - Error() string - } - FormatQuery(_ []uint8, _ string, _ ...interface{}) []uint8 - Insert(_ ...interface{}) interface { - Error() string - } + CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (Result, error) + CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (Result, error) + Delete(_ interface{}) error + Exec(_ interface{}, _ ...interface{}) (Result, error) + ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (Result, error) + ExecOne(_ interface{}, _ ...interface{}) (Result, error) + ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (Result, error) + ForceDelete(_ interface{}) error + FormatQuery(_ []byte, _ string, _ ...interface{}) []byte + Insert(_ ...interface{}) error Model(_ ...interface{}) *Query ModelContext(_ context.Context, _ ...interface{}) *Query - Query(_ interface{}, _ interface{}, _ ...interface{}) (Result, interface { - Error() string - }) - QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (Result, interface { - Error() string - }) - QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (Result, interface { - Error() string - }) - QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (Result, interface { - Error() string - }) - Select(_ interface{}) interface { - Error() string - } - Update(_ interface{}) interface { - Error() string - } + Query(_ interface{}, _ interface{}, _ ...interface{}) (Result, error) + QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (Result, error) + QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (Result, error) + QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (Result, error) + Select(_ interface{}) error + Update(_ interface{}) error } type DropTableOptions struct { @@ -96,7 +64,7 @@ type Field struct { OnUpdate string } -func (_ *Field) AppendValue(_ []uint8, _ reflect.Value, _ int) []uint8 { +func (_ *Field) AppendValue(_ []byte, _ reflect.Value, _ int) []byte { return nil } @@ -104,7 +72,7 @@ func (_ *Field) Copy() *Field { return nil } -func (_ *Field) HasFlag(_ uint8) bool { +func (_ *Field) HasFlag(_ byte) bool { return false } @@ -116,13 +84,11 @@ func (_ *Field) OmitZero() bool { return false } -func (_ *Field) ScanValue(_ reflect.Value, _ interface{}, _ int) interface { - Error() string -} { +func (_ *Field) ScanValue(_ reflect.Value, _ interface{}, _ int) error { return nil } -func (_ *Field) SetFlag(_ uint8) {} +func (_ *Field) SetFlag(_ byte) {} func (_ *Field) Value(_ reflect.Value) reflect.Value { return reflect.Value{} @@ -132,7 +98,7 @@ type Method struct { Index int } -func (_ *Method) AppendValue(_ []uint8, _ reflect.Value, _ int) []uint8 { +func (_ *Method) AppendValue(_ []byte, _ reflect.Value, _ int) []byte { return nil } @@ -145,55 +111,31 @@ func (_ *Method) Value(_ reflect.Value) reflect.Value { } type Model interface { - AddModel(_ ColumnScanner) interface { - Error() string - } - AfterDelete(_ context.Context, _ DB) interface { - Error() string - } - AfterInsert(_ context.Context, _ DB) interface { - Error() string - } - AfterQuery(_ context.Context, _ DB) interface { - Error() string - } - AfterSelect(_ context.Context, _ DB) interface { - Error() string - } - AfterUpdate(_ context.Context, _ DB) interface { - Error() string - } - BeforeDelete(_ context.Context, _ DB) interface { - Error() string - } - BeforeInsert(_ context.Context, _ DB) interface { - Error() string - } - BeforeSelectQuery(_ context.Context, _ DB, _ *Query) (*Query, interface { - Error() string - }) - BeforeUpdate(_ context.Context, _ DB) interface { - Error() string - } - Init() interface { - Error() string - } + AddModel(_ ColumnScanner) error + AfterDelete(_ context.Context, _ DB) error + AfterInsert(_ context.Context, _ DB) error + AfterQuery(_ context.Context, _ DB) error + AfterSelect(_ context.Context, _ DB) error + AfterUpdate(_ context.Context, _ DB) error + BeforeDelete(_ context.Context, _ DB) error + BeforeInsert(_ context.Context, _ DB) error + BeforeSelectQuery(_ context.Context, _ DB, _ *Query) (*Query, error) + BeforeUpdate(_ context.Context, _ DB) error + Init() error NewModel() ColumnScanner } -func Q(_ string, _ ...interface{}) *interface{} { +func Q(_ string, _ ...interface{}) interface{} { return nil } type Query struct{} -func (_ *Query) AppendFormat(_ []uint8, _ QueryFormatter) []uint8 { +func (_ *Query) AppendFormat(_ []byte, _ QueryFormatter) []byte { return nil } -func (_ *Query) Apply(_ func(*Query) (*Query, interface { - Error() string -})) *Query { +func (_ *Query) Apply(_ func(*Query) (*Query, error)) *Query { return nil } @@ -213,33 +155,23 @@ func (_ *Query) Copy() *Query { return nil } -func (_ *Query) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (Result, error) { return nil, nil } -func (_ *Query) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (Result, error) { return nil, nil } -func (_ *Query) Count() (int, interface { - Error() string -}) { +func (_ *Query) Count() (int, error) { return 0, nil } -func (_ *Query) CountEstimate(_ int) (int, interface { - Error() string -}) { +func (_ *Query) CountEstimate(_ int) (int, error) { return 0, nil } -func (_ *Query) CreateTable(_ *CreateTableOptions) interface { - Error() string -} { +func (_ *Query) CreateTable(_ *CreateTableOptions) error { return nil } @@ -247,9 +179,7 @@ func (_ *Query) DB(_ DB) *Query { return nil } -func (_ *Query) Delete(_ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) Delete(_ ...interface{}) (Result, error) { return nil, nil } @@ -257,9 +187,7 @@ func (_ *Query) Deleted() *Query { return nil } -func (_ *Query) DropTable(_ *DropTableOptions) interface { - Error() string -} { +func (_ *Query) DropTable(_ *DropTableOptions) error { return nil } @@ -267,27 +195,19 @@ func (_ *Query) ExcludeColumn(_ ...string) *Query { return nil } -func (_ *Query) Exec(_ interface{}, _ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) Exec(_ interface{}, _ ...interface{}) (Result, error) { return nil, nil } -func (_ *Query) ExecOne(_ interface{}, _ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) ExecOne(_ interface{}, _ ...interface{}) (Result, error) { return nil, nil } -func (_ *Query) Exists() (bool, interface { - Error() string -}) { +func (_ *Query) Exists() (bool, error) { return false, nil } -func (_ *Query) First() interface { - Error() string -} { +func (_ *Query) First() error { return nil } @@ -295,19 +215,15 @@ func (_ *Query) For(_ string, _ ...interface{}) *Query { return nil } -func (_ *Query) ForEach(_ interface{}) interface { - Error() string -} { +func (_ *Query) ForEach(_ interface{}) error { return nil } -func (_ *Query) ForceDelete(_ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) ForceDelete(_ ...interface{}) (Result, error) { return nil, nil } -func (_ *Query) FormatQuery(_ []uint8, _ string, _ ...interface{}) []uint8 { +func (_ *Query) FormatQuery(_ []byte, _ string, _ ...interface{}) []byte { return nil } @@ -331,9 +247,7 @@ func (_ *Query) Having(_ string, _ ...interface{}) *Query { return nil } -func (_ *Query) Insert(_ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) Insert(_ ...interface{}) (Result, error) { return nil, nil } @@ -349,9 +263,7 @@ func (_ *Query) JoinOnOr(_ string, _ ...interface{}) *Query { return nil } -func (_ *Query) Last() interface { - Error() string -} { +func (_ *Query) Last() error { return nil } @@ -383,21 +295,15 @@ func (_ *Query) OrderExpr(_ string, _ ...interface{}) *Query { return nil } -func (_ *Query) Query(_ interface{}, _ interface{}, _ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) Query(_ interface{}, _ interface{}, _ ...interface{}) (Result, error) { return nil, nil } -func (_ *Query) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (Result, error) { return nil, nil } -func (_ *Query) Relation(_ string, _ ...func(*Query) (*Query, interface { - Error() string -})) *Query { +func (_ *Query) Relation(_ string, _ ...func(*Query) (*Query, error)) *Query { return nil } @@ -405,27 +311,19 @@ func (_ *Query) Returning(_ string, _ ...interface{}) *Query { return nil } -func (_ *Query) Select(_ ...interface{}) interface { - Error() string -} { +func (_ *Query) Select(_ ...interface{}) error { return nil } -func (_ *Query) SelectAndCount(_ ...interface{}) (int, interface { - Error() string -}) { +func (_ *Query) SelectAndCount(_ ...interface{}) (int, error) { return 0, nil } -func (_ *Query) SelectAndCountEstimate(_ int, _ ...interface{}) (int, interface { - Error() string -}) { +func (_ *Query) SelectAndCountEstimate(_ int, _ ...interface{}) (int, error) { return 0, nil } -func (_ *Query) SelectOrInsert(_ ...interface{}) (bool, interface { - Error() string -}) { +func (_ *Query) SelectOrInsert(_ ...interface{}) (bool, error) { return false, nil } @@ -441,15 +339,11 @@ func (_ *Query) TableExpr(_ string, _ ...interface{}) *Query { return nil } -func (_ *Query) Update(_ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) Update(_ ...interface{}) (Result, error) { return nil, nil } -func (_ *Query) UpdateNotNull(_ ...interface{}) (Result, interface { - Error() string -}) { +func (_ *Query) UpdateNotNull(_ ...interface{}) (Result, error) { return nil, nil } @@ -461,9 +355,7 @@ func (_ *Query) Where(_ string, _ ...interface{}) *Query { return nil } -func (_ *Query) WhereGroup(_ func(*Query) (*Query, interface { - Error() string -})) *Query { +func (_ *Query) WhereGroup(_ func(*Query) (*Query, error)) *Query { return nil } @@ -479,9 +371,7 @@ func (_ *Query) WhereOr(_ string, _ ...interface{}) *Query { return nil } -func (_ *Query) WhereOrGroup(_ func(*Query) (*Query, interface { - Error() string -})) *Query { +func (_ *Query) WhereOrGroup(_ func(*Query) (*Query, error)) *Query { return nil } @@ -502,7 +392,7 @@ func (_ *Query) WrapWith(_ string) *Query { } type QueryFormatter interface { - FormatQuery(_ []uint8, _ string, _ ...interface{}) []uint8 + FormatQuery(_ []byte, _ string, _ ...interface{}) []byte } type Relation struct { @@ -549,13 +439,11 @@ type Table struct { func (_ *Table) AddField(_ *Field) {} -func (_ *Table) AppendParam(_ []uint8, _ reflect.Value, _ string) ([]uint8, bool) { +func (_ *Table) AppendParam(_ []byte, _ reflect.Value, _ string) ([]byte, bool) { return nil, false } -func (_ *Table) GetField(_ string) (*Field, interface { - Error() string -}) { +func (_ *Table) GetField(_ string) (*Field, error) { return nil, nil } @@ -576,48 +464,24 @@ func (_ *Table) String() string { } type TableModel interface { - AddJoin(_ interface{}) *interface{} - AddModel(_ ColumnScanner) interface { - Error() string - } - AfterDelete(_ context.Context, _ DB) interface { - Error() string - } - AfterInsert(_ context.Context, _ DB) interface { - Error() string - } - AfterQuery(_ context.Context, _ DB) interface { - Error() string - } - AfterSelect(_ context.Context, _ DB) interface { - Error() string - } - AfterUpdate(_ context.Context, _ DB) interface { - Error() string - } - AppendParam(_ []uint8, _ QueryFormatter, _ string) ([]uint8, bool) - BeforeDelete(_ context.Context, _ DB) interface { - Error() string - } - BeforeInsert(_ context.Context, _ DB) interface { - Error() string - } - BeforeSelectQuery(_ context.Context, _ DB, _ *Query) (*Query, interface { - Error() string - }) - BeforeUpdate(_ context.Context, _ DB) interface { - Error() string - } - GetJoin(_ string) *interface{} + AddJoin(_ interface{}) interface{} + AddModel(_ ColumnScanner) error + AfterDelete(_ context.Context, _ DB) error + AfterInsert(_ context.Context, _ DB) error + AfterQuery(_ context.Context, _ DB) error + AfterSelect(_ context.Context, _ DB) error + AfterUpdate(_ context.Context, _ DB) error + AppendParam(_ []byte, _ QueryFormatter, _ string) ([]byte, bool) + BeforeDelete(_ context.Context, _ DB) error + BeforeInsert(_ context.Context, _ DB) error + BeforeSelectQuery(_ context.Context, _ DB, _ *Query) (*Query, error) + BeforeUpdate(_ context.Context, _ DB) error + GetJoin(_ string) interface{} GetJoins() []interface{} Index() []int - Init() interface { - Error() string - } + Init() error IsNil() bool - Join(_ string, _ func(*Query) (*Query, interface { - Error() string - })) *interface{} + Join(_ string, _ func(*Query) (*Query, error)) interface{} Kind() reflect.Kind Mount(_ reflect.Value) NewModel() ColumnScanner diff --git a/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/stub.go b/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/stub.go index 0832aac36c4..d92b1486ef0 100644 --- a/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/stub.go +++ b/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/stub.go @@ -19,105 +19,75 @@ type Conn struct{} func (_ Conn) AddQueryHook(_ QueryHook) {} -func (_ Conn) Begin() (*Tx, interface { - Error() string -}) { +func (_ Conn) Begin() (*Tx, error) { return nil, nil } -func (_ Conn) Close() interface { - Error() string -} { +func (_ Conn) Close() error { return nil } -func (_ Conn) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) CreateComposite(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ Conn) CreateComposite(_ interface{}, _ interface{}) error { return nil } -func (_ Conn) CreateTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ Conn) CreateTable(_ interface{}, _ interface{}) error { return nil } -func (_ Conn) Delete(_ interface{}) interface { - Error() string -} { +func (_ Conn) Delete(_ interface{}) error { return nil } -func (_ Conn) DropComposite(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ Conn) DropComposite(_ interface{}, _ interface{}) error { return nil } -func (_ Conn) DropTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ Conn) DropTable(_ interface{}, _ interface{}) error { return nil } -func (_ Conn) Exec(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) Exec(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) ExecOne(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) ExecOne(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) ForceDelete(_ interface{}) interface { - Error() string -} { +func (_ Conn) ForceDelete(_ interface{}) error { return nil } -func (_ Conn) FormatQuery(_ []uint8, _ string, _ ...interface{}) []uint8 { +func (_ Conn) FormatQuery(_ []byte, _ string, _ ...interface{}) []byte { return nil } -func (_ Conn) Insert(_ ...interface{}) interface { - Error() string -} { +func (_ Conn) Insert(_ ...interface{}) error { return nil } -func (_ Conn) Model(_ ...interface{}) *interface{} { +func (_ Conn) Model(_ ...interface{}) interface{} { return nil } -func (_ Conn) ModelContext(_ context.Context, _ ...interface{}) *interface{} { +func (_ Conn) ModelContext(_ context.Context, _ ...interface{}) interface{} { return nil } @@ -129,53 +99,35 @@ func (_ Conn) PoolStats() *PoolStats { return nil } -func (_ Conn) Prepare(_ string) (*Stmt, interface { - Error() string -}) { +func (_ Conn) Prepare(_ string) (*Stmt, error) { return nil, nil } -func (_ Conn) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) RunInTransaction(_ func(*Tx) interface { - Error() string -}) interface { - Error() string -} { +func (_ Conn) RunInTransaction(_ func(*Tx) error) error { return nil } -func (_ Conn) Select(_ interface{}) interface { - Error() string -} { +func (_ Conn) Select(_ interface{}) error { return nil } -func (_ Conn) Update(_ interface{}) interface { - Error() string -} { +func (_ Conn) Update(_ interface{}) error { return nil } @@ -199,105 +151,75 @@ type DB struct{} func (_ DB) AddQueryHook(_ QueryHook) {} -func (_ DB) Begin() (*Tx, interface { - Error() string -}) { +func (_ DB) Begin() (*Tx, error) { return nil, nil } -func (_ DB) Close() interface { - Error() string -} { +func (_ DB) Close() error { return nil } -func (_ DB) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) CreateComposite(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ DB) CreateComposite(_ interface{}, _ interface{}) error { return nil } -func (_ DB) CreateTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ DB) CreateTable(_ interface{}, _ interface{}) error { return nil } -func (_ DB) Delete(_ interface{}) interface { - Error() string -} { +func (_ DB) Delete(_ interface{}) error { return nil } -func (_ DB) DropComposite(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ DB) DropComposite(_ interface{}, _ interface{}) error { return nil } -func (_ DB) DropTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ DB) DropTable(_ interface{}, _ interface{}) error { return nil } -func (_ DB) Exec(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) Exec(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) ExecOne(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) ExecOne(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) ForceDelete(_ interface{}) interface { - Error() string -} { +func (_ DB) ForceDelete(_ interface{}) error { return nil } -func (_ DB) FormatQuery(_ []uint8, _ string, _ ...interface{}) []uint8 { +func (_ DB) FormatQuery(_ []byte, _ string, _ ...interface{}) []byte { return nil } -func (_ DB) Insert(_ ...interface{}) interface { - Error() string -} { +func (_ DB) Insert(_ ...interface{}) error { return nil } -func (_ DB) Model(_ ...interface{}) *interface{} { +func (_ DB) Model(_ ...interface{}) interface{} { return nil } -func (_ DB) ModelContext(_ context.Context, _ ...interface{}) *interface{} { +func (_ DB) ModelContext(_ context.Context, _ ...interface{}) interface{} { return nil } @@ -309,53 +231,35 @@ func (_ DB) PoolStats() *PoolStats { return nil } -func (_ DB) Prepare(_ string) (*Stmt, interface { - Error() string -}) { +func (_ DB) Prepare(_ string) (*Stmt, error) { return nil, nil } -func (_ DB) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) RunInTransaction(_ func(*Tx) interface { - Error() string -}) interface { - Error() string -} { +func (_ DB) RunInTransaction(_ func(*Tx) error) error { return nil } -func (_ DB) Select(_ interface{}) interface { - Error() string -} { +func (_ DB) Select(_ interface{}) error { return nil } -func (_ DB) Update(_ interface{}) interface { - Error() string -} { +func (_ DB) Update(_ interface{}) error { return nil } @@ -401,27 +305,19 @@ func (_ *Listener) ChannelSize(_ int) <-chan *Notification { return nil } -func (_ *Listener) Close() interface { - Error() string -} { +func (_ *Listener) Close() error { return nil } -func (_ *Listener) Listen(_ ...string) interface { - Error() string -} { +func (_ *Listener) Listen(_ ...string) error { return nil } -func (_ *Listener) Receive() (string, string, interface { - Error() string -}) { +func (_ *Listener) Receive() (string, string, error) { return "", "", nil } -func (_ *Listener) ReceiveTimeout(_ time.Duration) (string, string, interface { - Error() string -}) { +func (_ *Listener) ReceiveTimeout(_ time.Duration) (string, string, error) { return "", "", nil } @@ -435,14 +331,10 @@ type Notification struct { } type Options struct { - Network string - Addr string - Dialer func(string, string) (net.Conn, interface { - Error() string - }) - OnConnect func(*Conn) interface { - Error() string - } + Network string + Addr string + Dialer func(string, string) (net.Conn, error) + OnConnect func(*Conn) error User string Password string Database string @@ -483,21 +375,15 @@ type QueryEvent struct { Params []interface{} Attempt int Result interface{} - Error interface { - Error() string - } - Data map[interface{}]interface{} + Error error + Data map[interface{}]interface{} } -func (_ *QueryEvent) FormattedQuery() (string, interface { - Error() string -}) { +func (_ *QueryEvent) FormattedQuery() (string, error) { return "", nil } -func (_ *QueryEvent) UnformattedQuery() (string, interface { - Error() string -}) { +func (_ *QueryEvent) UnformattedQuery() (string, error) { return "", nil } @@ -508,71 +394,49 @@ type QueryHook interface { type Stmt struct{} -func (_ *Stmt) Close() interface { - Error() string -} { +func (_ *Stmt) Close() error { return nil } -func (_ *Stmt) Exec(_ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) Exec(_ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) ExecContext(_ context.Context, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) ExecContext(_ context.Context, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) ExecOne(_ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) ExecOne(_ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) ExecOneContext(_ context.Context, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) ExecOneContext(_ context.Context, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) Query(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) Query(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) QueryContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) QueryContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) QueryOne(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) QueryOne(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) QueryOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) QueryOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } type Tx struct{} -func (_ *Tx) Begin() (*Tx, interface { - Error() string -}) { +func (_ *Tx) Begin() (*Tx, error) { return nil, nil } -func (_ *Tx) Commit() interface { - Error() string -} { +func (_ *Tx) Commit() error { return nil } @@ -580,131 +444,91 @@ func (_ *Tx) Context() context.Context { return nil } -func (_ *Tx) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) CreateTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ *Tx) CreateTable(_ interface{}, _ interface{}) error { return nil } -func (_ *Tx) Delete(_ interface{}) interface { - Error() string -} { +func (_ *Tx) Delete(_ interface{}) error { return nil } -func (_ *Tx) DropTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ *Tx) DropTable(_ interface{}, _ interface{}) error { return nil } -func (_ *Tx) Exec(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) Exec(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) ExecOne(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) ExecOne(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) ForceDelete(_ interface{}) interface { - Error() string -} { +func (_ *Tx) ForceDelete(_ interface{}) error { return nil } -func (_ *Tx) FormatQuery(_ []uint8, _ string, _ ...interface{}) []uint8 { +func (_ *Tx) FormatQuery(_ []byte, _ string, _ ...interface{}) []byte { return nil } -func (_ *Tx) Insert(_ ...interface{}) interface { - Error() string -} { +func (_ *Tx) Insert(_ ...interface{}) error { return nil } -func (_ *Tx) Model(_ ...interface{}) *interface{} { +func (_ *Tx) Model(_ ...interface{}) interface{} { return nil } -func (_ *Tx) ModelContext(_ context.Context, _ ...interface{}) *interface{} { +func (_ *Tx) ModelContext(_ context.Context, _ ...interface{}) interface{} { return nil } -func (_ *Tx) Prepare(_ string) (*Stmt, interface { - Error() string -}) { +func (_ *Tx) Prepare(_ string) (*Stmt, error) { return nil, nil } -func (_ *Tx) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) Rollback() interface { - Error() string -} { +func (_ *Tx) Rollback() error { return nil } -func (_ *Tx) RunInTransaction(_ func(*Tx) interface { - Error() string -}) interface { - Error() string -} { +func (_ *Tx) RunInTransaction(_ func(*Tx) error) error { return nil } -func (_ *Tx) Select(_ interface{}) interface { - Error() string -} { +func (_ *Tx) Select(_ interface{}) error { return nil } @@ -712,8 +536,6 @@ func (_ *Tx) Stmt(_ *Stmt) *Stmt { return nil } -func (_ *Tx) Update(_ interface{}) interface { - Error() string -} { +func (_ *Tx) Update(_ interface{}) error { return nil } diff --git a/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/v9/stub.go b/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/v9/stub.go index 3ddcee60a45..58a8442cc7c 100644 --- a/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/v9/stub.go +++ b/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/v9/stub.go @@ -19,87 +19,59 @@ type Conn struct{} func (_ Conn) AddQueryHook(_ QueryHook) {} -func (_ Conn) Begin() (*Tx, interface { - Error() string -}) { +func (_ Conn) Begin() (*Tx, error) { return nil, nil } -func (_ Conn) Close() interface { - Error() string -} { +func (_ Conn) Close() error { return nil } -func (_ Conn) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) CreateComposite(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ Conn) CreateComposite(_ interface{}, _ interface{}) error { return nil } -func (_ Conn) CreateTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ Conn) CreateTable(_ interface{}, _ interface{}) error { return nil } -func (_ Conn) Delete(_ interface{}) interface { - Error() string -} { +func (_ Conn) Delete(_ interface{}) error { return nil } -func (_ Conn) DropComposite(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ Conn) DropComposite(_ interface{}, _ interface{}) error { return nil } -func (_ Conn) DropTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ Conn) DropTable(_ interface{}, _ interface{}) error { return nil } -func (_ Conn) Exec(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) Exec(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) ExecOne(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) ExecOne(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) ForceDelete(_ interface{}) interface { - Error() string -} { +func (_ Conn) ForceDelete(_ interface{}) error { return nil } @@ -107,17 +79,15 @@ func (_ Conn) Formatter() interface{} { return nil } -func (_ Conn) Insert(_ ...interface{}) interface { - Error() string -} { +func (_ Conn) Insert(_ ...interface{}) error { return nil } -func (_ Conn) Model(_ ...interface{}) *interface{} { +func (_ Conn) Model(_ ...interface{}) interface{} { return nil } -func (_ Conn) ModelContext(_ context.Context, _ ...interface{}) *interface{} { +func (_ Conn) ModelContext(_ context.Context, _ ...interface{}) interface{} { return nil } @@ -129,53 +99,35 @@ func (_ Conn) PoolStats() *PoolStats { return nil } -func (_ Conn) Prepare(_ string) (*Stmt, interface { - Error() string -}) { +func (_ Conn) Prepare(_ string) (*Stmt, error) { return nil, nil } -func (_ Conn) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ Conn) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ Conn) RunInTransaction(_ func(*Tx) interface { - Error() string -}) interface { - Error() string -} { +func (_ Conn) RunInTransaction(_ func(*Tx) error) error { return nil } -func (_ Conn) Select(_ interface{}) interface { - Error() string -} { +func (_ Conn) Select(_ interface{}) error { return nil } -func (_ Conn) Update(_ interface{}) interface { - Error() string -} { +func (_ Conn) Update(_ interface{}) error { return nil } @@ -199,87 +151,59 @@ type DB struct{} func (_ DB) AddQueryHook(_ QueryHook) {} -func (_ DB) Begin() (*Tx, interface { - Error() string -}) { +func (_ DB) Begin() (*Tx, error) { return nil, nil } -func (_ DB) Close() interface { - Error() string -} { +func (_ DB) Close() error { return nil } -func (_ DB) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) CreateComposite(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ DB) CreateComposite(_ interface{}, _ interface{}) error { return nil } -func (_ DB) CreateTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ DB) CreateTable(_ interface{}, _ interface{}) error { return nil } -func (_ DB) Delete(_ interface{}) interface { - Error() string -} { +func (_ DB) Delete(_ interface{}) error { return nil } -func (_ DB) DropComposite(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ DB) DropComposite(_ interface{}, _ interface{}) error { return nil } -func (_ DB) DropTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ DB) DropTable(_ interface{}, _ interface{}) error { return nil } -func (_ DB) Exec(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) Exec(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) ExecOne(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) ExecOne(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) ForceDelete(_ interface{}) interface { - Error() string -} { +func (_ DB) ForceDelete(_ interface{}) error { return nil } @@ -287,17 +211,15 @@ func (_ DB) Formatter() interface{} { return nil } -func (_ DB) Insert(_ ...interface{}) interface { - Error() string -} { +func (_ DB) Insert(_ ...interface{}) error { return nil } -func (_ DB) Model(_ ...interface{}) *interface{} { +func (_ DB) Model(_ ...interface{}) interface{} { return nil } -func (_ DB) ModelContext(_ context.Context, _ ...interface{}) *interface{} { +func (_ DB) ModelContext(_ context.Context, _ ...interface{}) interface{} { return nil } @@ -309,53 +231,35 @@ func (_ DB) PoolStats() *PoolStats { return nil } -func (_ DB) Prepare(_ string) (*Stmt, interface { - Error() string -}) { +func (_ DB) Prepare(_ string) (*Stmt, error) { return nil, nil } -func (_ DB) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ DB) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ DB) RunInTransaction(_ func(*Tx) interface { - Error() string -}) interface { - Error() string -} { +func (_ DB) RunInTransaction(_ func(*Tx) error) error { return nil } -func (_ DB) Select(_ interface{}) interface { - Error() string -} { +func (_ DB) Select(_ interface{}) error { return nil } -func (_ DB) Update(_ interface{}) interface { - Error() string -} { +func (_ DB) Update(_ interface{}) error { return nil } @@ -401,27 +305,19 @@ func (_ *Listener) ChannelSize(_ int) <-chan *Notification { return nil } -func (_ *Listener) Close() interface { - Error() string -} { +func (_ *Listener) Close() error { return nil } -func (_ *Listener) Listen(_ ...string) interface { - Error() string -} { +func (_ *Listener) Listen(_ ...string) error { return nil } -func (_ *Listener) Receive() (string, string, interface { - Error() string -}) { +func (_ *Listener) Receive() (string, string, error) { return "", "", nil } -func (_ *Listener) ReceiveTimeout(_ time.Duration) (string, string, interface { - Error() string -}) { +func (_ *Listener) ReceiveTimeout(_ time.Duration) (string, string, error) { return "", "", nil } @@ -435,22 +331,18 @@ type Notification struct { } type Options struct { - Network string - Addr string - Dialer func(context.Context, string, string) (net.Conn, interface { - Error() string - }) - User string - Password string - Database string - ApplicationName string - TLSConfig *tls.Config - DialTimeout time.Duration - ReadTimeout time.Duration - WriteTimeout time.Duration - OnConnect func(*Conn) interface { - Error() string - } + Network string + Addr string + Dialer func(context.Context, string, string) (net.Conn, error) + User string + Password string + Database string + ApplicationName string + TLSConfig *tls.Config + DialTimeout time.Duration + ReadTimeout time.Duration + WriteTimeout time.Duration + OnConnect func(*Conn) error MaxRetries int RetryStatementTimeout bool MinRetryBackoff time.Duration @@ -483,106 +375,72 @@ type QueryEvent struct { Query interface{} Params []interface{} Result interface{} - Err interface { - Error() string - } - Stash map[interface{}]interface{} + Err error + Stash map[interface{}]interface{} } -func (_ *QueryEvent) FormattedQuery() (string, interface { - Error() string -}) { +func (_ *QueryEvent) FormattedQuery() (string, error) { return "", nil } -func (_ *QueryEvent) UnformattedQuery() (string, interface { - Error() string -}) { +func (_ *QueryEvent) UnformattedQuery() (string, error) { return "", nil } type QueryHook interface { - AfterQuery(_ context.Context, _ *QueryEvent) interface { - Error() string - } - BeforeQuery(_ context.Context, _ *QueryEvent) (context.Context, interface { - Error() string - }) + AfterQuery(_ context.Context, _ *QueryEvent) error + BeforeQuery(_ context.Context, _ *QueryEvent) (context.Context, error) } type Stmt struct{} -func (_ *Stmt) Close() interface { - Error() string -} { +func (_ *Stmt) Close() error { return nil } -func (_ *Stmt) Exec(_ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) Exec(_ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) ExecContext(_ context.Context, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) ExecContext(_ context.Context, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) ExecOne(_ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) ExecOne(_ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) ExecOneContext(_ context.Context, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) ExecOneContext(_ context.Context, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) Query(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) Query(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) QueryContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) QueryContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) QueryOne(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) QueryOne(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Stmt) QueryOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Stmt) QueryOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } type Tx struct{} -func (_ *Tx) Begin() (*Tx, interface { - Error() string -}) { +func (_ *Tx) Begin() (*Tx, error) { return nil, nil } -func (_ *Tx) Close() interface { - Error() string -} { +func (_ *Tx) Close() error { return nil } -func (_ *Tx) Commit() interface { - Error() string -} { +func (_ *Tx) Commit() error { return nil } @@ -590,63 +448,43 @@ func (_ *Tx) Context() context.Context { return nil } -func (_ *Tx) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) CreateTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ *Tx) CreateTable(_ interface{}, _ interface{}) error { return nil } -func (_ *Tx) Delete(_ interface{}) interface { - Error() string -} { +func (_ *Tx) Delete(_ interface{}) error { return nil } -func (_ *Tx) DropTable(_ interface{}, _ *interface{}) interface { - Error() string -} { +func (_ *Tx) DropTable(_ interface{}, _ interface{}) error { return nil } -func (_ *Tx) Exec(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) Exec(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) ExecOne(_ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) ExecOne(_ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) ForceDelete(_ interface{}) interface { - Error() string -} { +func (_ *Tx) ForceDelete(_ interface{}) error { return nil } @@ -654,67 +492,47 @@ func (_ *Tx) Formatter() interface{} { return nil } -func (_ *Tx) Insert(_ ...interface{}) interface { - Error() string -} { +func (_ *Tx) Insert(_ ...interface{}) error { return nil } -func (_ *Tx) Model(_ ...interface{}) *interface{} { +func (_ *Tx) Model(_ ...interface{}) interface{} { return nil } -func (_ *Tx) ModelContext(_ context.Context, _ ...interface{}) *interface{} { +func (_ *Tx) ModelContext(_ context.Context, _ ...interface{}) interface{} { return nil } -func (_ *Tx) Prepare(_ string) (*Stmt, interface { - Error() string -}) { +func (_ *Tx) Prepare(_ string) (*Stmt, error) { return nil, nil } -func (_ *Tx) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) Query(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, interface { - Error() string -}) { +func (_ *Tx) QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ *Tx) Rollback() interface { - Error() string -} { +func (_ *Tx) Rollback() error { return nil } -func (_ *Tx) RunInTransaction(_ func(*Tx) interface { - Error() string -}) interface { - Error() string -} { +func (_ *Tx) RunInTransaction(_ func(*Tx) error) error { return nil } -func (_ *Tx) Select(_ interface{}) interface { - Error() string -} { +func (_ *Tx) Select(_ interface{}) error { return nil } @@ -722,8 +540,6 @@ func (_ *Tx) Stmt(_ *Stmt) *Stmt { return nil } -func (_ *Tx) Update(_ interface{}) interface { - Error() string -} { +func (_ *Tx) Update(_ interface{}) error { return nil } diff --git a/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/go.mod b/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/go.mod index 7e5ad05ed01..a38d4a4518b 100644 --- a/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/go.mod +++ b/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/go.mod @@ -4,6 +4,5 @@ go 1.14 require ( github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 - github.com/github/depstubber v0.0.0-20200414025517-59c2db8e9405 // indirect golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 ) diff --git a/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/modules.txt b/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/modules.txt index 768df0566ee..2fdb2ae4eae 100644 --- a/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/modules.txt +++ b/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/modules.txt @@ -1,9 +1,6 @@ # github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 ## explicit github.com/codeskyblue/go-sh -# github.com/github/depstubber v0.0.0-20200414025517-59c2db8e9405 -## explicit -github.com/github/depstubber # golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 ## explicit golang.org/x/crypto diff --git a/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/mongo/options/stub.go b/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/mongo/options/stub.go index a9275c51610..f435b8e112f 100644 --- a/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/mongo/options/stub.go +++ b/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/mongo/options/stub.go @@ -63,11 +63,11 @@ type ClientOptions struct { MaxConnIdleTime *time.Duration MaxPoolSize *uint64 MinPoolSize *uint64 - PoolMonitor *interface{} - Monitor *interface{} - ReadConcern *interface{} - ReadPreference *interface{} - Registry *interface{} + PoolMonitor interface{} + Monitor interface{} + ReadConcern interface{} + ReadPreference interface{} + Registry interface{} ReplicaSet *string RetryWrites *bool RetryReads *bool @@ -75,7 +75,7 @@ type ClientOptions struct { Direct *bool SocketTimeout *time.Duration TLSConfig *tls.Config - WriteConcern *interface{} + WriteConcern interface{} ZlibLevel *int ZstdLevel *int AutoEncryptionOptions *AutoEncryptionOptions @@ -143,23 +143,23 @@ func (_ *ClientOptions) SetMinPoolSize(_ uint64) *ClientOptions { return nil } -func (_ *ClientOptions) SetMonitor(_ *interface{}) *ClientOptions { +func (_ *ClientOptions) SetMonitor(_ interface{}) *ClientOptions { return nil } -func (_ *ClientOptions) SetPoolMonitor(_ *interface{}) *ClientOptions { +func (_ *ClientOptions) SetPoolMonitor(_ interface{}) *ClientOptions { return nil } -func (_ *ClientOptions) SetReadConcern(_ *interface{}) *ClientOptions { +func (_ *ClientOptions) SetReadConcern(_ interface{}) *ClientOptions { return nil } -func (_ *ClientOptions) SetReadPreference(_ *interface{}) *ClientOptions { +func (_ *ClientOptions) SetReadPreference(_ interface{}) *ClientOptions { return nil } -func (_ *ClientOptions) SetRegistry(_ *interface{}) *ClientOptions { +func (_ *ClientOptions) SetRegistry(_ interface{}) *ClientOptions { return nil } @@ -187,7 +187,7 @@ func (_ *ClientOptions) SetTLSConfig(_ *tls.Config) *ClientOptions { return nil } -func (_ *ClientOptions) SetWriteConcern(_ *interface{}) *ClientOptions { +func (_ *ClientOptions) SetWriteConcern(_ interface{}) *ClientOptions { return nil } diff --git a/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/mongo/stub.go b/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/mongo/stub.go index 013a9e90963..8cdf40dc69e 100644 --- a/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/mongo/stub.go +++ b/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/mongo/stub.go @@ -59,7 +59,7 @@ func (_ *Client) Connect(_ context.Context) error { return nil } -func (_ *Client) Database(_ string, _ ...*interface{}) *Database { +func (_ *Client) Database(_ string, _ ...interface{}) *Database { return nil } @@ -67,11 +67,11 @@ func (_ *Client) Disconnect(_ context.Context) error { return nil } -func (_ *Client) ListDatabaseNames(_ context.Context, _ interface{}, _ ...*interface{}) ([]string, error) { +func (_ *Client) ListDatabaseNames(_ context.Context, _ interface{}, _ ...interface{}) ([]string, error) { return nil, nil } -func (_ *Client) ListDatabases(_ context.Context, _ interface{}, _ ...*interface{}) (ListDatabasesResult, error) { +func (_ *Client) ListDatabases(_ context.Context, _ interface{}, _ ...interface{}) (ListDatabasesResult, error) { return ListDatabasesResult{}, nil } @@ -79,11 +79,11 @@ func (_ *Client) NumberSessionsInProgress() int { return 0 } -func (_ *Client) Ping(_ context.Context, _ *interface{}) error { +func (_ *Client) Ping(_ context.Context, _ interface{}) error { return nil } -func (_ *Client) StartSession(_ ...*interface{}) (Session, error) { +func (_ *Client) StartSession(_ ...interface{}) (Session, error) { return nil, nil } @@ -91,29 +91,29 @@ func (_ *Client) UseSession(_ context.Context, _ func(SessionContext) error) err return nil } -func (_ *Client) UseSessionWithOptions(_ context.Context, _ *interface{}, _ func(SessionContext) error) error { +func (_ *Client) UseSessionWithOptions(_ context.Context, _ interface{}, _ func(SessionContext) error) error { return nil } -func (_ *Client) Watch(_ context.Context, _ interface{}, _ ...*interface{}) (*ChangeStream, error) { +func (_ *Client) Watch(_ context.Context, _ interface{}, _ ...interface{}) (*ChangeStream, error) { return nil, nil } type Collection struct{} -func (_ *Collection) Aggregate(_ context.Context, _ interface{}, _ ...*interface{}) (*Cursor, error) { +func (_ *Collection) Aggregate(_ context.Context, _ interface{}, _ ...interface{}) (*Cursor, error) { return nil, nil } -func (_ *Collection) BulkWrite(_ context.Context, _ []WriteModel, _ ...*interface{}) (*BulkWriteResult, error) { +func (_ *Collection) BulkWrite(_ context.Context, _ []WriteModel, _ ...interface{}) (*BulkWriteResult, error) { return nil, nil } -func (_ *Collection) Clone(_ ...*interface{}) (*Collection, error) { +func (_ *Collection) Clone(_ ...interface{}) (*Collection, error) { return nil, nil } -func (_ *Collection) CountDocuments(_ context.Context, _ interface{}, _ ...*interface{}) (int64, error) { +func (_ *Collection) CountDocuments(_ context.Context, _ interface{}, _ ...interface{}) (int64, error) { return 0, nil } @@ -121,15 +121,15 @@ func (_ *Collection) Database() *Database { return nil } -func (_ *Collection) DeleteMany(_ context.Context, _ interface{}, _ ...*interface{}) (*DeleteResult, error) { +func (_ *Collection) DeleteMany(_ context.Context, _ interface{}, _ ...interface{}) (*DeleteResult, error) { return nil, nil } -func (_ *Collection) DeleteOne(_ context.Context, _ interface{}, _ ...*interface{}) (*DeleteResult, error) { +func (_ *Collection) DeleteOne(_ context.Context, _ interface{}, _ ...interface{}) (*DeleteResult, error) { return nil, nil } -func (_ *Collection) Distinct(_ context.Context, _ string, _ interface{}, _ ...*interface{}) ([]interface{}, error) { +func (_ *Collection) Distinct(_ context.Context, _ string, _ interface{}, _ ...interface{}) ([]interface{}, error) { return nil, nil } @@ -137,27 +137,27 @@ func (_ *Collection) Drop(_ context.Context) error { return nil } -func (_ *Collection) EstimatedDocumentCount(_ context.Context, _ ...*interface{}) (int64, error) { +func (_ *Collection) EstimatedDocumentCount(_ context.Context, _ ...interface{}) (int64, error) { return 0, nil } -func (_ *Collection) Find(_ context.Context, _ interface{}, _ ...*interface{}) (*Cursor, error) { +func (_ *Collection) Find(_ context.Context, _ interface{}, _ ...interface{}) (*Cursor, error) { return nil, nil } -func (_ *Collection) FindOne(_ context.Context, _ interface{}, _ ...*interface{}) *SingleResult { +func (_ *Collection) FindOne(_ context.Context, _ interface{}, _ ...interface{}) *SingleResult { return nil } -func (_ *Collection) FindOneAndDelete(_ context.Context, _ interface{}, _ ...*interface{}) *SingleResult { +func (_ *Collection) FindOneAndDelete(_ context.Context, _ interface{}, _ ...interface{}) *SingleResult { return nil } -func (_ *Collection) FindOneAndReplace(_ context.Context, _ interface{}, _ interface{}, _ ...*interface{}) *SingleResult { +func (_ *Collection) FindOneAndReplace(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) *SingleResult { return nil } -func (_ *Collection) FindOneAndUpdate(_ context.Context, _ interface{}, _ interface{}, _ ...*interface{}) *SingleResult { +func (_ *Collection) FindOneAndUpdate(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) *SingleResult { return nil } @@ -165,11 +165,11 @@ func (_ *Collection) Indexes() IndexView { return IndexView{} } -func (_ *Collection) InsertMany(_ context.Context, _ []interface{}, _ ...*interface{}) (*InsertManyResult, error) { +func (_ *Collection) InsertMany(_ context.Context, _ []interface{}, _ ...interface{}) (*InsertManyResult, error) { return nil, nil } -func (_ *Collection) InsertOne(_ context.Context, _ interface{}, _ ...*interface{}) (*InsertOneResult, error) { +func (_ *Collection) InsertOne(_ context.Context, _ interface{}, _ ...interface{}) (*InsertOneResult, error) { return nil, nil } @@ -177,19 +177,19 @@ func (_ *Collection) Name() string { return "" } -func (_ *Collection) ReplaceOne(_ context.Context, _ interface{}, _ interface{}, _ ...*interface{}) (*UpdateResult, error) { +func (_ *Collection) ReplaceOne(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (*UpdateResult, error) { return nil, nil } -func (_ *Collection) UpdateMany(_ context.Context, _ interface{}, _ interface{}, _ ...*interface{}) (*UpdateResult, error) { +func (_ *Collection) UpdateMany(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (*UpdateResult, error) { return nil, nil } -func (_ *Collection) UpdateOne(_ context.Context, _ interface{}, _ interface{}, _ ...*interface{}) (*UpdateResult, error) { +func (_ *Collection) UpdateOne(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (*UpdateResult, error) { return nil, nil } -func (_ *Collection) Watch(_ context.Context, _ interface{}, _ ...*interface{}) (*ChangeStream, error) { +func (_ *Collection) Watch(_ context.Context, _ interface{}, _ ...interface{}) (*ChangeStream, error) { return nil, nil } @@ -231,7 +231,7 @@ func (_ *Cursor) TryNext(_ context.Context) bool { type Database struct{} -func (_ *Database) Aggregate(_ context.Context, _ interface{}, _ ...*interface{}) (*Cursor, error) { +func (_ *Database) Aggregate(_ context.Context, _ interface{}, _ ...interface{}) (*Cursor, error) { return nil, nil } @@ -239,7 +239,7 @@ func (_ *Database) Client() *Client { return nil } -func (_ *Database) Collection(_ string, _ ...*interface{}) *Collection { +func (_ *Database) Collection(_ string, _ ...interface{}) *Collection { return nil } @@ -247,11 +247,11 @@ func (_ *Database) Drop(_ context.Context) error { return nil } -func (_ *Database) ListCollectionNames(_ context.Context, _ interface{}, _ ...*interface{}) ([]string, error) { +func (_ *Database) ListCollectionNames(_ context.Context, _ interface{}, _ ...interface{}) ([]string, error) { return nil, nil } -func (_ *Database) ListCollections(_ context.Context, _ interface{}, _ ...*interface{}) (*Cursor, error) { +func (_ *Database) ListCollections(_ context.Context, _ interface{}, _ ...interface{}) (*Cursor, error) { return nil, nil } @@ -259,27 +259,27 @@ func (_ *Database) Name() string { return "" } -func (_ *Database) ReadConcern() *interface{} { +func (_ *Database) ReadConcern() interface{} { return nil } -func (_ *Database) ReadPreference() *interface{} { +func (_ *Database) ReadPreference() interface{} { return nil } -func (_ *Database) RunCommand(_ context.Context, _ interface{}, _ ...*interface{}) *SingleResult { +func (_ *Database) RunCommand(_ context.Context, _ interface{}, _ ...interface{}) *SingleResult { return nil } -func (_ *Database) RunCommandCursor(_ context.Context, _ interface{}, _ ...*interface{}) (*Cursor, error) { +func (_ *Database) RunCommandCursor(_ context.Context, _ interface{}, _ ...interface{}) (*Cursor, error) { return nil, nil } -func (_ *Database) Watch(_ context.Context, _ interface{}, _ ...*interface{}) (*ChangeStream, error) { +func (_ *Database) Watch(_ context.Context, _ interface{}, _ ...interface{}) (*ChangeStream, error) { return nil, nil } -func (_ *Database) WriteConcern() *interface{} { +func (_ *Database) WriteConcern() interface{} { return nil } @@ -295,28 +295,28 @@ type DeleteResult struct { type IndexModel struct { Keys interface{} - Options *interface{} + Options interface{} } type IndexView struct{} -func (_ IndexView) CreateMany(_ context.Context, _ []IndexModel, _ ...*interface{}) ([]string, error) { +func (_ IndexView) CreateMany(_ context.Context, _ []IndexModel, _ ...interface{}) ([]string, error) { return nil, nil } -func (_ IndexView) CreateOne(_ context.Context, _ IndexModel, _ ...*interface{}) (string, error) { +func (_ IndexView) CreateOne(_ context.Context, _ IndexModel, _ ...interface{}) (string, error) { return "", nil } -func (_ IndexView) DropAll(_ context.Context, _ ...*interface{}) (interface{}, error) { +func (_ IndexView) DropAll(_ context.Context, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ IndexView) DropOne(_ context.Context, _ string, _ ...*interface{}) (interface{}, error) { +func (_ IndexView) DropOne(_ context.Context, _ string, _ ...interface{}) (interface{}, error) { return nil, nil } -func (_ IndexView) List(_ context.Context, _ ...*interface{}) (*Cursor, error) { +func (_ IndexView) List(_ context.Context, _ ...interface{}) (*Cursor, error) { return nil, nil } @@ -338,20 +338,20 @@ type Pipeline []interface{} type Session interface { AbortTransaction(_ context.Context) error AdvanceClusterTime(_ interface{}) error - AdvanceOperationTime(_ *interface{}) error + AdvanceOperationTime(_ interface{}) error Client() *Client ClusterTime() interface{} CommitTransaction(_ context.Context) error EndSession(_ context.Context) - OperationTime() *interface{} - StartTransaction(_ ...*interface{}) error - WithTransaction(_ context.Context, _ func(SessionContext) (interface{}, error), _ ...*interface{}) (interface{}, error) + OperationTime() interface{} + StartTransaction(_ ...interface{}) error + WithTransaction(_ context.Context, _ func(SessionContext) (interface{}, error), _ ...interface{}) (interface{}, error) } type SessionContext interface { AbortTransaction(_ context.Context) error AdvanceClusterTime(_ interface{}) error - AdvanceOperationTime(_ *interface{}) error + AdvanceOperationTime(_ interface{}) error Client() *Client ClusterTime() interface{} CommitTransaction(_ context.Context) error @@ -359,10 +359,10 @@ type SessionContext interface { Done() <-chan struct{} EndSession(_ context.Context) Err() error - OperationTime() *interface{} - StartTransaction(_ ...*interface{}) error + OperationTime() interface{} + StartTransaction(_ ...interface{}) error Value(_ interface{}) interface{} - WithTransaction(_ context.Context, _ func(SessionContext) (interface{}, error), _ ...*interface{}) (interface{}, error) + WithTransaction(_ context.Context, _ func(SessionContext) (interface{}, error), _ ...interface{}) (interface{}, error) } type SingleResult struct{} diff --git a/ql/test/query-tests/Security/CWE-312/go.mod b/ql/test/query-tests/Security/CWE-312/go.mod index 358ac75f5d0..d56c33ffc85 100644 --- a/ql/test/query-tests/Security/CWE-312/go.mod +++ b/ql/test/query-tests/Security/CWE-312/go.mod @@ -3,7 +3,6 @@ module main go 1.14 require ( - github.com/github/depstubber v0.0.0-20200414023404-c355b630c381 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/sirupsen/logrus v1.5.0 ) diff --git a/ql/test/query-tests/Security/CWE-312/vendor/modules.txt b/ql/test/query-tests/Security/CWE-312/vendor/modules.txt index e6b6e8f0401..b0149947f41 100644 --- a/ql/test/query-tests/Security/CWE-312/vendor/modules.txt +++ b/ql/test/query-tests/Security/CWE-312/vendor/modules.txt @@ -1,6 +1,3 @@ -# github.com/github/depstubber v0.0.0-20200414023404-c355b630c381 -## explicit -github.com/github/depstubber # github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b ## explicit github.com/golang/glog diff --git a/ql/test/query-tests/Security/CWE-643/go.mod b/ql/test/query-tests/Security/CWE-643/go.mod index 92c3e25f94c..fc7016cc9f6 100644 --- a/ql/test/query-tests/Security/CWE-643/go.mod +++ b/ql/test/query-tests/Security/CWE-643/go.mod @@ -8,13 +8,7 @@ require ( github.com/antchfx/jsonquery v1.1.2 github.com/antchfx/xmlquery v1.2.3 github.com/antchfx/xpath v1.1.5 - github.com/github/depstubber v0.0.0-20200413231600-392d5a70208e // indirect github.com/go-xmlpath/xmlpath v0.0.0-20150820204837-860cbeca3ebc - github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/jbowtie/gokogiri v0.0.0-20190301021639-37f655d3078f - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/santhosh-tekuri/xpathparser v1.0.0 - golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect - gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect - gopkg.in/xmlpath.v2 v2.0.0-20150820204837-860cbeca3ebc // indirect ) diff --git a/ql/test/query-tests/Security/CWE-643/vendor/github.com/ChrisTrenkamp/goxpath/stub.go b/ql/test/query-tests/Security/CWE-643/vendor/github.com/ChrisTrenkamp/goxpath/stub.go index 9fc8651cf61..4b1e74cc192 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/github.com/ChrisTrenkamp/goxpath/stub.go +++ b/ql/test/query-tests/Security/CWE-643/vendor/github.com/ChrisTrenkamp/goxpath/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/ChrisTrenkamp/goxpath, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/ChrisTrenkamp/goxpath (exports: Opts,FuncOpts,XPathExec; functions: Parse,MustParse,ParseExec) // Package goxpath is a stub of github.com/ChrisTrenkamp/goxpath, generated by depstubber. @@ -22,41 +23,29 @@ type Opts struct { Vars map[string]interface{} } -func Parse(_ string) (XPathExec, interface { - Error() string -}) { +func Parse(_ string) (XPathExec, error) { return XPathExec{}, nil } -func ParseExec(_ string, _ interface{}, _ ...FuncOpts) (interface{}, interface { - Error() string -}) { +func ParseExec(_ string, _ interface{}, _ ...FuncOpts) (interface{}, error) { return nil, nil } type XPathExec struct{} -func (_ XPathExec) Exec(_ interface{}, _ ...FuncOpts) (interface{}, interface { - Error() string -}) { +func (_ XPathExec) Exec(_ interface{}, _ ...FuncOpts) (interface{}, error) { return nil, nil } -func (_ XPathExec) ExecBool(_ interface{}, _ ...FuncOpts) (bool, interface { - Error() string -}) { +func (_ XPathExec) ExecBool(_ interface{}, _ ...FuncOpts) (bool, error) { return false, nil } -func (_ XPathExec) ExecNode(_ interface{}, _ ...FuncOpts) (interface{}, interface { - Error() string -}) { +func (_ XPathExec) ExecNode(_ interface{}, _ ...FuncOpts) (interface{}, error) { return nil, nil } -func (_ XPathExec) ExecNum(_ interface{}, _ ...FuncOpts) (float64, interface { - Error() string -}) { +func (_ XPathExec) ExecNum(_ interface{}, _ ...FuncOpts) (float64, error) { return 0, nil } diff --git a/ql/test/query-tests/Security/CWE-643/vendor/github.com/ChrisTrenkamp/goxpath/tree/stub.go b/ql/test/query-tests/Security/CWE-643/vendor/github.com/ChrisTrenkamp/goxpath/tree/stub.go index 9c538842b2a..7cc3b01c626 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/github.com/ChrisTrenkamp/goxpath/tree/stub.go +++ b/ql/test/query-tests/Security/CWE-643/vendor/github.com/ChrisTrenkamp/goxpath/tree/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/ChrisTrenkamp/goxpath/tree, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/ChrisTrenkamp/goxpath/tree (exports: Node,String; functions: ) // Package tree is a stub of github.com/ChrisTrenkamp/goxpath/tree, generated by depstubber. diff --git a/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/htmlquery/stub.go b/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/htmlquery/stub.go index 0f7f7095aa8..0bac0acfe55 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/htmlquery/stub.go +++ b/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/htmlquery/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/antchfx/htmlquery, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/antchfx/htmlquery (exports: ; functions: Find,FindOne,QueryAll,Query) // Package htmlquery is a stub of github.com/antchfx/htmlquery, generated by depstubber. @@ -8,22 +9,18 @@ package htmlquery import () -func Find(_ *interface{}, _ string) []*interface{} { +func Find(_ interface{}, _ string) []interface{} { return nil } -func FindOne(_ *interface{}, _ string) *interface{} { +func FindOne(_ interface{}, _ string) interface{} { return nil } -func Query(_ *interface{}, _ string) (*interface{}, interface { - Error() string -}) { +func Query(_ interface{}, _ string) (interface{}, error) { return nil, nil } -func QueryAll(_ *interface{}, _ string) ([]*interface{}, interface { - Error() string -}) { +func QueryAll(_ interface{}, _ string) ([]interface{}, error) { return nil, nil } diff --git a/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/jsonquery/stub.go b/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/jsonquery/stub.go index 8aca2f88266..2948daae031 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/jsonquery/stub.go +++ b/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/jsonquery/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/antchfx/jsonquery, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/antchfx/jsonquery (exports: Node; functions: Find,FindOne,QueryAll,Query) // Package jsonquery is a stub of github.com/antchfx/jsonquery, generated by depstubber. @@ -40,14 +41,10 @@ func (_ *Node) SelectElement(_ string) *Node { type NodeType uint -func Query(_ *Node, _ string) (*Node, interface { - Error() string -}) { +func Query(_ *Node, _ string) (*Node, error) { return nil, nil } -func QueryAll(_ *Node, _ string) ([]*Node, interface { - Error() string -}) { +func QueryAll(_ *Node, _ string) ([]*Node, error) { return nil, nil } diff --git a/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/xmlquery/stub.go b/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/xmlquery/stub.go index 771d87641fc..a4c5d8cc806 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/xmlquery/stub.go +++ b/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/xmlquery/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/antchfx/xmlquery, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/antchfx/xmlquery (exports: Node; functions: Find,FindOne,FindEach,FindEachWithBreak,QueryAll,Query) // Package xmlquery is a stub of github.com/antchfx/xmlquery, generated by depstubber. @@ -57,14 +58,10 @@ func (_ *Node) SelectElements(_ string) []*Node { type NodeType uint -func Query(_ *Node, _ string) (*Node, interface { - Error() string -}) { +func Query(_ *Node, _ string) (*Node, error) { return nil, nil } -func QueryAll(_ *Node, _ string) ([]*Node, interface { - Error() string -}) { +func QueryAll(_ *Node, _ string) ([]*Node, error) { return nil, nil } diff --git a/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/xpath/stub.go b/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/xpath/stub.go index cb611c75edd..d470abbed9d 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/xpath/stub.go +++ b/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/xpath/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/antchfx/xpath, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/antchfx/xpath (exports: ; functions: Compile,MustCompile,Select) // Package xpath is a stub of github.com/antchfx/xpath, generated by depstubber. @@ -8,9 +9,7 @@ package xpath import () -func Compile(_ string) (*Expr, interface { - Error() string -}) { +func Compile(_ string) (*Expr, error) { return nil, nil } diff --git a/ql/test/query-tests/Security/CWE-643/vendor/github.com/go-xmlpath/xmlpath/stub.go b/ql/test/query-tests/Security/CWE-643/vendor/github.com/go-xmlpath/xmlpath/stub.go index 7df7a981cdd..2ec18b739df 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/github.com/go-xmlpath/xmlpath/stub.go +++ b/ql/test/query-tests/Security/CWE-643/vendor/github.com/go-xmlpath/xmlpath/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/go-xmlpath/xmlpath, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/go-xmlpath/xmlpath (exports: ; functions: Compile,MustCompile) // Package xmlpath is a stub of github.com/go-xmlpath/xmlpath, generated by depstubber. @@ -8,9 +9,7 @@ package xmlpath import () -func Compile(_ string) (*Path, interface { - Error() string -}) { +func Compile(_ string) (*Path, error) { return nil, nil } @@ -30,7 +29,7 @@ func MustCompile(_ string) *Path { type Node struct{} -func (_ *Node) Bytes() []uint8 { +func (_ *Node) Bytes() []byte { return nil } @@ -40,7 +39,7 @@ func (_ *Node) String() string { type Path struct{} -func (_ *Path) Bytes(_ *Node) ([]uint8, bool) { +func (_ *Path) Bytes(_ *Node) ([]byte, bool) { return nil, false } diff --git a/ql/test/query-tests/Security/CWE-643/vendor/github.com/jbowtie/gokogiri/xml/stub.go b/ql/test/query-tests/Security/CWE-643/vendor/github.com/jbowtie/gokogiri/xml/stub.go index f0ac31d47cb..26db7472cdf 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/github.com/jbowtie/gokogiri/xml/stub.go +++ b/ql/test/query-tests/Security/CWE-643/vendor/github.com/jbowtie/gokogiri/xml/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/jbowtie/gokogiri/xml, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/jbowtie/gokogiri/xml (exports: Node; functions: ) // Package xml is a stub of github.com/jbowtie/gokogiri/xml, generated by depstubber. @@ -12,21 +13,15 @@ type AttributeNode struct { XmlNode *XmlNode } -func (_ AttributeNode) AddChild(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) AddChild(_ interface{}) error { return nil } -func (_ AttributeNode) AddNextSibling(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) AddNextSibling(_ interface{}) error { return nil } -func (_ AttributeNode) AddPreviousSibling(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) AddPreviousSibling(_ interface{}) error { return nil } @@ -50,9 +45,7 @@ func (_ AttributeNode) Attributes() map[string]*AttributeNode { func (_ AttributeNode) BookkeepFragment(_ *DocumentFragment) {} -func (_ AttributeNode) Coerce(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ AttributeNode) Coerce(_ interface{}) ([]Node, error) { return nil, nil } @@ -102,7 +95,7 @@ func (_ AttributeNode) DocType() NodeType { return 0 } -func (_ AttributeNode) DocXPathCtx() *interface{} { +func (_ AttributeNode) DocXPathCtx() interface{} { return nil } @@ -114,9 +107,7 @@ func (_ AttributeNode) DuplicateTo(_ Document, _ int) Node { return nil } -func (_ AttributeNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, interface { - Error() string -}) { +func (_ AttributeNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, error) { return nil, nil } @@ -134,31 +125,23 @@ func (_ AttributeNode) InnerHtml() string { return "" } -func (_ AttributeNode) InputEncoding() []uint8 { +func (_ AttributeNode) InputEncoding() []byte { return nil } -func (_ AttributeNode) InsertAfter(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) InsertAfter(_ interface{}) error { return nil } -func (_ AttributeNode) InsertBefore(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) InsertBefore(_ interface{}) error { return nil } -func (_ AttributeNode) InsertBegin(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) InsertBegin(_ interface{}) error { return nil } -func (_ AttributeNode) InsertEnd(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) InsertEnd(_ interface{}) error { return nil } @@ -202,7 +185,7 @@ func (_ AttributeNode) NodeType() NodeType { return 0 } -func (_ AttributeNode) OutputEncoding() []uint8 { +func (_ AttributeNode) OutputEncoding() []byte { return nil } @@ -210,9 +193,7 @@ func (_ AttributeNode) Parent() Node { return nil } -func (_ AttributeNode) ParseFragment(_ []uint8, _ []uint8, _ ParseOption) (*DocumentFragment, interface { - Error() string -}) { +func (_ AttributeNode) ParseFragment(_ []byte, _ []byte, _ ParseOption) (*DocumentFragment, error) { return nil, nil } @@ -224,9 +205,7 @@ func (_ AttributeNode) PreviousSibling() Node { return nil } -func (_ AttributeNode) RecursivelyRemoveNamespaces() interface { - Error() string -} { +func (_ AttributeNode) RecursivelyRemoveNamespaces() error { return nil } @@ -238,9 +217,7 @@ func (_ AttributeNode) RemoveUnlinkedNode(_ interface{}) bool { return false } -func (_ AttributeNode) Replace(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) Replace(_ interface{}) error { return nil } @@ -252,19 +229,15 @@ func (_ AttributeNode) Root() *ElementNode { return nil } -func (_ AttributeNode) Search(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ AttributeNode) Search(_ interface{}) ([]Node, error) { return nil, nil } -func (_ AttributeNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, interface { - Error() string -}) { +func (_ AttributeNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, error) { return nil, nil } -func (_ AttributeNode) SerializeWithFormat(_ SerializationOption, _ []uint8, _ []uint8) ([]uint8, int) { +func (_ AttributeNode) SerializeWithFormat(_ SerializationOption, _ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -272,21 +245,15 @@ func (_ AttributeNode) SetAttr(_ string, _ string) string { return "" } -func (_ AttributeNode) SetChildren(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) SetChildren(_ interface{}) error { return nil } -func (_ AttributeNode) SetContent(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) SetContent(_ interface{}) error { return nil } -func (_ AttributeNode) SetInnerHtml(_ interface{}) interface { - Error() string -} { +func (_ AttributeNode) SetInnerHtml(_ interface{}) error { return nil } @@ -298,11 +265,11 @@ func (_ AttributeNode) SetNsAttr(_ string, _ string, _ string) string { return "" } -func (_ AttributeNode) ToBuffer(_ []uint8) []uint8 { +func (_ AttributeNode) ToBuffer(_ []byte) []byte { return nil } -func (_ AttributeNode) ToHtml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ AttributeNode) ToHtml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -310,7 +277,7 @@ func (_ AttributeNode) ToUnformattedXml() string { return "" } -func (_ AttributeNode) ToXml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ AttributeNode) ToXml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -324,9 +291,7 @@ func (_ AttributeNode) Uri() string { return "" } -func (_ AttributeNode) Wrap(_ string) interface { - Error() string -} { +func (_ AttributeNode) Wrap(_ string) error { return nil } @@ -344,21 +309,15 @@ type CDataNode struct { XmlNode *XmlNode } -func (_ CDataNode) AddChild(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) AddChild(_ interface{}) error { return nil } -func (_ CDataNode) AddNextSibling(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) AddNextSibling(_ interface{}) error { return nil } -func (_ CDataNode) AddPreviousSibling(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) AddPreviousSibling(_ interface{}) error { return nil } @@ -382,9 +341,7 @@ func (_ CDataNode) Attributes() map[string]*AttributeNode { func (_ CDataNode) BookkeepFragment(_ *DocumentFragment) {} -func (_ CDataNode) Coerce(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ CDataNode) Coerce(_ interface{}) ([]Node, error) { return nil, nil } @@ -434,7 +391,7 @@ func (_ CDataNode) DocType() NodeType { return 0 } -func (_ CDataNode) DocXPathCtx() *interface{} { +func (_ CDataNode) DocXPathCtx() interface{} { return nil } @@ -446,9 +403,7 @@ func (_ CDataNode) DuplicateTo(_ Document, _ int) Node { return nil } -func (_ CDataNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, interface { - Error() string -}) { +func (_ CDataNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, error) { return nil, nil } @@ -466,31 +421,23 @@ func (_ CDataNode) InnerHtml() string { return "" } -func (_ CDataNode) InputEncoding() []uint8 { +func (_ CDataNode) InputEncoding() []byte { return nil } -func (_ CDataNode) InsertAfter(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) InsertAfter(_ interface{}) error { return nil } -func (_ CDataNode) InsertBefore(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) InsertBefore(_ interface{}) error { return nil } -func (_ CDataNode) InsertBegin(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) InsertBegin(_ interface{}) error { return nil } -func (_ CDataNode) InsertEnd(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) InsertEnd(_ interface{}) error { return nil } @@ -534,7 +481,7 @@ func (_ CDataNode) NodeType() NodeType { return 0 } -func (_ CDataNode) OutputEncoding() []uint8 { +func (_ CDataNode) OutputEncoding() []byte { return nil } @@ -542,9 +489,7 @@ func (_ CDataNode) Parent() Node { return nil } -func (_ CDataNode) ParseFragment(_ []uint8, _ []uint8, _ ParseOption) (*DocumentFragment, interface { - Error() string -}) { +func (_ CDataNode) ParseFragment(_ []byte, _ []byte, _ ParseOption) (*DocumentFragment, error) { return nil, nil } @@ -556,9 +501,7 @@ func (_ CDataNode) PreviousSibling() Node { return nil } -func (_ CDataNode) RecursivelyRemoveNamespaces() interface { - Error() string -} { +func (_ CDataNode) RecursivelyRemoveNamespaces() error { return nil } @@ -570,9 +513,7 @@ func (_ CDataNode) RemoveUnlinkedNode(_ interface{}) bool { return false } -func (_ CDataNode) Replace(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) Replace(_ interface{}) error { return nil } @@ -584,19 +525,15 @@ func (_ CDataNode) Root() *ElementNode { return nil } -func (_ CDataNode) Search(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ CDataNode) Search(_ interface{}) ([]Node, error) { return nil, nil } -func (_ CDataNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, interface { - Error() string -}) { +func (_ CDataNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, error) { return nil, nil } -func (_ CDataNode) SerializeWithFormat(_ SerializationOption, _ []uint8, _ []uint8) ([]uint8, int) { +func (_ CDataNode) SerializeWithFormat(_ SerializationOption, _ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -604,21 +541,15 @@ func (_ CDataNode) SetAttr(_ string, _ string) string { return "" } -func (_ CDataNode) SetChildren(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) SetChildren(_ interface{}) error { return nil } -func (_ CDataNode) SetContent(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) SetContent(_ interface{}) error { return nil } -func (_ CDataNode) SetInnerHtml(_ interface{}) interface { - Error() string -} { +func (_ CDataNode) SetInnerHtml(_ interface{}) error { return nil } @@ -634,11 +565,11 @@ func (_ CDataNode) String() string { return "" } -func (_ CDataNode) ToBuffer(_ []uint8) []uint8 { +func (_ CDataNode) ToBuffer(_ []byte) []byte { return nil } -func (_ CDataNode) ToHtml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ CDataNode) ToHtml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -646,7 +577,7 @@ func (_ CDataNode) ToUnformattedXml() string { return "" } -func (_ CDataNode) ToXml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ CDataNode) ToXml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -660,9 +591,7 @@ func (_ CDataNode) Uri() string { return "" } -func (_ CDataNode) Wrap(_ string) interface { - Error() string -} { +func (_ CDataNode) Wrap(_ string) error { return nil } @@ -670,21 +599,15 @@ type CommentNode struct { XmlNode *XmlNode } -func (_ CommentNode) AddChild(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) AddChild(_ interface{}) error { return nil } -func (_ CommentNode) AddNextSibling(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) AddNextSibling(_ interface{}) error { return nil } -func (_ CommentNode) AddPreviousSibling(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) AddPreviousSibling(_ interface{}) error { return nil } @@ -708,9 +631,7 @@ func (_ CommentNode) Attributes() map[string]*AttributeNode { func (_ CommentNode) BookkeepFragment(_ *DocumentFragment) {} -func (_ CommentNode) Coerce(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ CommentNode) Coerce(_ interface{}) ([]Node, error) { return nil, nil } @@ -760,7 +681,7 @@ func (_ CommentNode) DocType() NodeType { return 0 } -func (_ CommentNode) DocXPathCtx() *interface{} { +func (_ CommentNode) DocXPathCtx() interface{} { return nil } @@ -772,9 +693,7 @@ func (_ CommentNode) DuplicateTo(_ Document, _ int) Node { return nil } -func (_ CommentNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, interface { - Error() string -}) { +func (_ CommentNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, error) { return nil, nil } @@ -792,31 +711,23 @@ func (_ CommentNode) InnerHtml() string { return "" } -func (_ CommentNode) InputEncoding() []uint8 { +func (_ CommentNode) InputEncoding() []byte { return nil } -func (_ CommentNode) InsertAfter(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) InsertAfter(_ interface{}) error { return nil } -func (_ CommentNode) InsertBefore(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) InsertBefore(_ interface{}) error { return nil } -func (_ CommentNode) InsertBegin(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) InsertBegin(_ interface{}) error { return nil } -func (_ CommentNode) InsertEnd(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) InsertEnd(_ interface{}) error { return nil } @@ -860,7 +771,7 @@ func (_ CommentNode) NodeType() NodeType { return 0 } -func (_ CommentNode) OutputEncoding() []uint8 { +func (_ CommentNode) OutputEncoding() []byte { return nil } @@ -868,9 +779,7 @@ func (_ CommentNode) Parent() Node { return nil } -func (_ CommentNode) ParseFragment(_ []uint8, _ []uint8, _ ParseOption) (*DocumentFragment, interface { - Error() string -}) { +func (_ CommentNode) ParseFragment(_ []byte, _ []byte, _ ParseOption) (*DocumentFragment, error) { return nil, nil } @@ -882,9 +791,7 @@ func (_ CommentNode) PreviousSibling() Node { return nil } -func (_ CommentNode) RecursivelyRemoveNamespaces() interface { - Error() string -} { +func (_ CommentNode) RecursivelyRemoveNamespaces() error { return nil } @@ -896,9 +803,7 @@ func (_ CommentNode) RemoveUnlinkedNode(_ interface{}) bool { return false } -func (_ CommentNode) Replace(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) Replace(_ interface{}) error { return nil } @@ -910,19 +815,15 @@ func (_ CommentNode) Root() *ElementNode { return nil } -func (_ CommentNode) Search(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ CommentNode) Search(_ interface{}) ([]Node, error) { return nil, nil } -func (_ CommentNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, interface { - Error() string -}) { +func (_ CommentNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, error) { return nil, nil } -func (_ CommentNode) SerializeWithFormat(_ SerializationOption, _ []uint8, _ []uint8) ([]uint8, int) { +func (_ CommentNode) SerializeWithFormat(_ SerializationOption, _ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -930,21 +831,15 @@ func (_ CommentNode) SetAttr(_ string, _ string) string { return "" } -func (_ CommentNode) SetChildren(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) SetChildren(_ interface{}) error { return nil } -func (_ CommentNode) SetContent(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) SetContent(_ interface{}) error { return nil } -func (_ CommentNode) SetInnerHtml(_ interface{}) interface { - Error() string -} { +func (_ CommentNode) SetInnerHtml(_ interface{}) error { return nil } @@ -960,11 +855,11 @@ func (_ CommentNode) String() string { return "" } -func (_ CommentNode) ToBuffer(_ []uint8) []uint8 { +func (_ CommentNode) ToBuffer(_ []byte) []byte { return nil } -func (_ CommentNode) ToHtml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ CommentNode) ToHtml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -972,7 +867,7 @@ func (_ CommentNode) ToUnformattedXml() string { return "" } -func (_ CommentNode) ToXml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ CommentNode) ToXml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -986,9 +881,7 @@ func (_ CommentNode) Uri() string { return "" } -func (_ CommentNode) Wrap(_ string) interface { - Error() string -} { +func (_ CommentNode) Wrap(_ string) error { return nil } @@ -1003,17 +896,13 @@ type Document interface { DocPtr() interface{} DocRef() Document DocType() NodeType - DocXPathCtx() *interface{} + DocXPathCtx() interface{} Free() - InputEncoding() []uint8 + InputEncoding() []byte NodeById(_ string) *ElementNode - OutputEncoding() []uint8 - ParseFragment(_ []uint8, _ []uint8, _ ParseOption) (*DocumentFragment, interface { - Error() string - }) - RecursivelyRemoveNamespaces() interface { - Error() string - } + OutputEncoding() []byte + ParseFragment(_ []byte, _ []byte, _ ParseOption) (*DocumentFragment, error) + RecursivelyRemoveNamespaces() error RemoveUnlinkedNode(_ interface{}) bool Root() *ElementNode String() string @@ -1023,25 +912,19 @@ type Document interface { type DocumentFragment struct { Node Node - InEncoding []uint8 - OutEncoding []uint8 + InEncoding []byte + OutEncoding []byte } -func (_ DocumentFragment) AddChild(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) AddChild(_ interface{}) error { return nil } -func (_ DocumentFragment) AddNextSibling(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) AddNextSibling(_ interface{}) error { return nil } -func (_ DocumentFragment) AddPreviousSibling(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) AddPreviousSibling(_ interface{}) error { return nil } @@ -1061,9 +944,7 @@ func (_ DocumentFragment) Attributes() map[string]*AttributeNode { return nil } -func (_ DocumentFragment) Coerce(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ DocumentFragment) Coerce(_ interface{}) ([]Node, error) { return nil, nil } @@ -1089,9 +970,7 @@ func (_ DocumentFragment) DuplicateTo(_ Document, _ int) Node { return nil } -func (_ DocumentFragment) EvalXPath(_ interface{}, _ interface{}) (interface{}, interface { - Error() string -}) { +func (_ DocumentFragment) EvalXPath(_ interface{}, _ interface{}) (interface{}, error) { return nil, nil } @@ -1107,27 +986,19 @@ func (_ DocumentFragment) InnerHtml() string { return "" } -func (_ DocumentFragment) InsertAfter(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) InsertAfter(_ interface{}) error { return nil } -func (_ DocumentFragment) InsertBefore(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) InsertBefore(_ interface{}) error { return nil } -func (_ DocumentFragment) InsertBegin(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) InsertBegin(_ interface{}) error { return nil } -func (_ DocumentFragment) InsertEnd(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) InsertEnd(_ interface{}) error { return nil } @@ -1171,9 +1042,7 @@ func (_ DocumentFragment) Parent() Node { return nil } -func (_ DocumentFragment) ParseFragment(_ []uint8, _ []uint8, _ ParseOption) (*DocumentFragment, interface { - Error() string -}) { +func (_ DocumentFragment) ParseFragment(_ []byte, _ []byte, _ ParseOption) (*DocumentFragment, error) { return nil, nil } @@ -1185,17 +1054,13 @@ func (_ DocumentFragment) PreviousSibling() Node { return nil } -func (_ DocumentFragment) RecursivelyRemoveNamespaces() interface { - Error() string -} { +func (_ DocumentFragment) RecursivelyRemoveNamespaces() error { return nil } func (_ DocumentFragment) RemoveDefaultNamespace() {} -func (_ DocumentFragment) Replace(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) Replace(_ interface{}) error { return nil } @@ -1203,19 +1068,15 @@ func (_ DocumentFragment) ResetChildren() {} func (_ DocumentFragment) ResetNodePtr() {} -func (_ DocumentFragment) Search(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ DocumentFragment) Search(_ interface{}) ([]Node, error) { return nil, nil } -func (_ DocumentFragment) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, interface { - Error() string -}) { +func (_ DocumentFragment) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, error) { return nil, nil } -func (_ DocumentFragment) SerializeWithFormat(_ SerializationOption, _ []uint8, _ []uint8) ([]uint8, int) { +func (_ DocumentFragment) SerializeWithFormat(_ SerializationOption, _ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -1223,21 +1084,15 @@ func (_ DocumentFragment) SetAttr(_ string, _ string) string { return "" } -func (_ DocumentFragment) SetChildren(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) SetChildren(_ interface{}) error { return nil } -func (_ DocumentFragment) SetContent(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) SetContent(_ interface{}) error { return nil } -func (_ DocumentFragment) SetInnerHtml(_ interface{}) interface { - Error() string -} { +func (_ DocumentFragment) SetInnerHtml(_ interface{}) error { return nil } @@ -1249,7 +1104,7 @@ func (_ DocumentFragment) SetNsAttr(_ string, _ string, _ string) string { return "" } -func (_ DocumentFragment) ToHtml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ DocumentFragment) ToHtml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -1257,15 +1112,13 @@ func (_ DocumentFragment) ToUnformattedXml() string { return "" } -func (_ DocumentFragment) ToXml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ DocumentFragment) ToXml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } func (_ DocumentFragment) Unlink() {} -func (_ DocumentFragment) Wrap(_ string) interface { - Error() string -} { +func (_ DocumentFragment) Wrap(_ string) error { return nil } @@ -1279,7 +1132,7 @@ func (_ *DocumentFragment) String() string { return "" } -func (_ *DocumentFragment) ToBuffer(_ []uint8) []uint8 { +func (_ *DocumentFragment) ToBuffer(_ []byte) []byte { return nil } @@ -1287,21 +1140,15 @@ type ElementNode struct { XmlNode *XmlNode } -func (_ ElementNode) AddChild(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) AddChild(_ interface{}) error { return nil } -func (_ ElementNode) AddNextSibling(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) AddNextSibling(_ interface{}) error { return nil } -func (_ ElementNode) AddPreviousSibling(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) AddPreviousSibling(_ interface{}) error { return nil } @@ -1325,9 +1172,7 @@ func (_ ElementNode) Attributes() map[string]*AttributeNode { func (_ ElementNode) BookkeepFragment(_ *DocumentFragment) {} -func (_ ElementNode) Coerce(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ ElementNode) Coerce(_ interface{}) ([]Node, error) { return nil, nil } @@ -1377,7 +1222,7 @@ func (_ ElementNode) DocType() NodeType { return 0 } -func (_ ElementNode) DocXPathCtx() *interface{} { +func (_ ElementNode) DocXPathCtx() interface{} { return nil } @@ -1389,9 +1234,7 @@ func (_ ElementNode) DuplicateTo(_ Document, _ int) Node { return nil } -func (_ ElementNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, interface { - Error() string -}) { +func (_ ElementNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, error) { return nil, nil } @@ -1409,31 +1252,23 @@ func (_ ElementNode) InnerHtml() string { return "" } -func (_ ElementNode) InputEncoding() []uint8 { +func (_ ElementNode) InputEncoding() []byte { return nil } -func (_ ElementNode) InsertAfter(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) InsertAfter(_ interface{}) error { return nil } -func (_ ElementNode) InsertBefore(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) InsertBefore(_ interface{}) error { return nil } -func (_ ElementNode) InsertBegin(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) InsertBegin(_ interface{}) error { return nil } -func (_ ElementNode) InsertEnd(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) InsertEnd(_ interface{}) error { return nil } @@ -1477,7 +1312,7 @@ func (_ ElementNode) NodeType() NodeType { return 0 } -func (_ ElementNode) OutputEncoding() []uint8 { +func (_ ElementNode) OutputEncoding() []byte { return nil } @@ -1485,9 +1320,7 @@ func (_ ElementNode) Parent() Node { return nil } -func (_ ElementNode) ParseFragment(_ []uint8, _ []uint8, _ ParseOption) (*DocumentFragment, interface { - Error() string -}) { +func (_ ElementNode) ParseFragment(_ []byte, _ []byte, _ ParseOption) (*DocumentFragment, error) { return nil, nil } @@ -1499,9 +1332,7 @@ func (_ ElementNode) PreviousSibling() Node { return nil } -func (_ ElementNode) RecursivelyRemoveNamespaces() interface { - Error() string -} { +func (_ ElementNode) RecursivelyRemoveNamespaces() error { return nil } @@ -1513,9 +1344,7 @@ func (_ ElementNode) RemoveUnlinkedNode(_ interface{}) bool { return false } -func (_ ElementNode) Replace(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) Replace(_ interface{}) error { return nil } @@ -1527,19 +1356,15 @@ func (_ ElementNode) Root() *ElementNode { return nil } -func (_ ElementNode) Search(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ ElementNode) Search(_ interface{}) ([]Node, error) { return nil, nil } -func (_ ElementNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, interface { - Error() string -}) { +func (_ ElementNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, error) { return nil, nil } -func (_ ElementNode) SerializeWithFormat(_ SerializationOption, _ []uint8, _ []uint8) ([]uint8, int) { +func (_ ElementNode) SerializeWithFormat(_ SerializationOption, _ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -1547,21 +1372,15 @@ func (_ ElementNode) SetAttr(_ string, _ string) string { return "" } -func (_ ElementNode) SetChildren(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) SetChildren(_ interface{}) error { return nil } -func (_ ElementNode) SetContent(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) SetContent(_ interface{}) error { return nil } -func (_ ElementNode) SetInnerHtml(_ interface{}) interface { - Error() string -} { +func (_ ElementNode) SetInnerHtml(_ interface{}) error { return nil } @@ -1577,11 +1396,11 @@ func (_ ElementNode) String() string { return "" } -func (_ ElementNode) ToBuffer(_ []uint8) []uint8 { +func (_ ElementNode) ToBuffer(_ []byte) []byte { return nil } -func (_ ElementNode) ToHtml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ ElementNode) ToHtml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -1589,7 +1408,7 @@ func (_ ElementNode) ToUnformattedXml() string { return "" } -func (_ ElementNode) ToXml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ ElementNode) ToXml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -1603,9 +1422,7 @@ func (_ ElementNode) Uri() string { return "" } -func (_ ElementNode) Wrap(_ string) interface { - Error() string -} { +func (_ ElementNode) Wrap(_ string) error { return nil } @@ -1615,46 +1432,28 @@ type NamespaceDeclaration struct { } type Node interface { - AddChild(_ interface{}) interface { - Error() string - } - AddNextSibling(_ interface{}) interface { - Error() string - } - AddPreviousSibling(_ interface{}) interface { - Error() string - } + AddChild(_ interface{}) error + AddNextSibling(_ interface{}) error + AddPreviousSibling(_ interface{}) error Attr(_ string) string Attribute(_ string) *AttributeNode AttributeList() []*AttributeNode Attributes() map[string]*AttributeNode - Coerce(_ interface{}) ([]Node, interface { - Error() string - }) + Coerce(_ interface{}) ([]Node, error) Content() string CountChildren() int DeclareNamespace(_ string, _ string) DeclaredNamespaces() []NamespaceDeclaration Duplicate(_ int) Node DuplicateTo(_ Document, _ int) Node - EvalXPath(_ interface{}, _ interface{}) (interface{}, interface { - Error() string - }) + EvalXPath(_ interface{}, _ interface{}) (interface{}, error) EvalXPathAsBoolean(_ interface{}, _ interface{}) bool FirstChild() Node InnerHtml() string - InsertAfter(_ interface{}) interface { - Error() string - } - InsertBefore(_ interface{}) interface { - Error() string - } - InsertBegin(_ interface{}) interface { - Error() string - } - InsertEnd(_ interface{}) interface { - Error() string - } + InsertAfter(_ interface{}) error + InsertBefore(_ interface{}) error + InsertBegin(_ interface{}) error + InsertEnd(_ interface{}) error IsValid() bool LastChild() Node LineNumber() int @@ -1665,50 +1464,32 @@ type Node interface { NodePtr() interface{} NodeType() NodeType Parent() Node - ParseFragment(_ []uint8, _ []uint8, _ ParseOption) (*DocumentFragment, interface { - Error() string - }) + ParseFragment(_ []byte, _ []byte, _ ParseOption) (*DocumentFragment, error) Path() string PreviousSibling() Node - RecursivelyRemoveNamespaces() interface { - Error() string - } + RecursivelyRemoveNamespaces() error Remove() RemoveDefaultNamespace() - Replace(_ interface{}) interface { - Error() string - } + Replace(_ interface{}) error ResetChildren() ResetNodePtr() - Search(_ interface{}) ([]Node, interface { - Error() string - }) - SearchWithVariables(_ interface{}, _ interface{}) ([]Node, interface { - Error() string - }) - SerializeWithFormat(_ SerializationOption, _ []uint8, _ []uint8) ([]uint8, int) + Search(_ interface{}) ([]Node, error) + SearchWithVariables(_ interface{}, _ interface{}) ([]Node, error) + SerializeWithFormat(_ SerializationOption, _ []byte, _ []byte) ([]byte, int) SetAttr(_ string, _ string) string - SetChildren(_ interface{}) interface { - Error() string - } - SetContent(_ interface{}) interface { - Error() string - } - SetInnerHtml(_ interface{}) interface { - Error() string - } + SetChildren(_ interface{}) error + SetContent(_ interface{}) error + SetInnerHtml(_ interface{}) error SetName(_ string) SetNamespace(_ string, _ string) SetNsAttr(_ string, _ string, _ string) string String() string - ToBuffer(_ []uint8) []uint8 - ToHtml(_ []uint8, _ []uint8) ([]uint8, int) + ToBuffer(_ []byte) []byte + ToHtml(_ []byte, _ []byte) ([]byte, int) ToUnformattedXml() string - ToXml(_ []uint8, _ []uint8) ([]uint8, int) + ToXml(_ []byte, _ []byte) ([]byte, int) Unlink() - Wrap(_ string) interface { - Error() string - } + Wrap(_ string) error } type NodeType int @@ -1719,21 +1500,15 @@ type ProcessingInstructionNode struct { XmlNode *XmlNode } -func (_ ProcessingInstructionNode) AddChild(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) AddChild(_ interface{}) error { return nil } -func (_ ProcessingInstructionNode) AddNextSibling(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) AddNextSibling(_ interface{}) error { return nil } -func (_ ProcessingInstructionNode) AddPreviousSibling(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) AddPreviousSibling(_ interface{}) error { return nil } @@ -1757,9 +1532,7 @@ func (_ ProcessingInstructionNode) Attributes() map[string]*AttributeNode { func (_ ProcessingInstructionNode) BookkeepFragment(_ *DocumentFragment) {} -func (_ ProcessingInstructionNode) Coerce(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ ProcessingInstructionNode) Coerce(_ interface{}) ([]Node, error) { return nil, nil } @@ -1809,7 +1582,7 @@ func (_ ProcessingInstructionNode) DocType() NodeType { return 0 } -func (_ ProcessingInstructionNode) DocXPathCtx() *interface{} { +func (_ ProcessingInstructionNode) DocXPathCtx() interface{} { return nil } @@ -1821,9 +1594,7 @@ func (_ ProcessingInstructionNode) DuplicateTo(_ Document, _ int) Node { return nil } -func (_ ProcessingInstructionNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, interface { - Error() string -}) { +func (_ ProcessingInstructionNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, error) { return nil, nil } @@ -1841,31 +1612,23 @@ func (_ ProcessingInstructionNode) InnerHtml() string { return "" } -func (_ ProcessingInstructionNode) InputEncoding() []uint8 { +func (_ ProcessingInstructionNode) InputEncoding() []byte { return nil } -func (_ ProcessingInstructionNode) InsertAfter(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) InsertAfter(_ interface{}) error { return nil } -func (_ ProcessingInstructionNode) InsertBefore(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) InsertBefore(_ interface{}) error { return nil } -func (_ ProcessingInstructionNode) InsertBegin(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) InsertBegin(_ interface{}) error { return nil } -func (_ ProcessingInstructionNode) InsertEnd(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) InsertEnd(_ interface{}) error { return nil } @@ -1909,7 +1672,7 @@ func (_ ProcessingInstructionNode) NodeType() NodeType { return 0 } -func (_ ProcessingInstructionNode) OutputEncoding() []uint8 { +func (_ ProcessingInstructionNode) OutputEncoding() []byte { return nil } @@ -1917,9 +1680,7 @@ func (_ ProcessingInstructionNode) Parent() Node { return nil } -func (_ ProcessingInstructionNode) ParseFragment(_ []uint8, _ []uint8, _ ParseOption) (*DocumentFragment, interface { - Error() string -}) { +func (_ ProcessingInstructionNode) ParseFragment(_ []byte, _ []byte, _ ParseOption) (*DocumentFragment, error) { return nil, nil } @@ -1931,9 +1692,7 @@ func (_ ProcessingInstructionNode) PreviousSibling() Node { return nil } -func (_ ProcessingInstructionNode) RecursivelyRemoveNamespaces() interface { - Error() string -} { +func (_ ProcessingInstructionNode) RecursivelyRemoveNamespaces() error { return nil } @@ -1945,9 +1704,7 @@ func (_ ProcessingInstructionNode) RemoveUnlinkedNode(_ interface{}) bool { return false } -func (_ ProcessingInstructionNode) Replace(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) Replace(_ interface{}) error { return nil } @@ -1959,19 +1716,15 @@ func (_ ProcessingInstructionNode) Root() *ElementNode { return nil } -func (_ ProcessingInstructionNode) Search(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ ProcessingInstructionNode) Search(_ interface{}) ([]Node, error) { return nil, nil } -func (_ ProcessingInstructionNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, interface { - Error() string -}) { +func (_ ProcessingInstructionNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, error) { return nil, nil } -func (_ ProcessingInstructionNode) SerializeWithFormat(_ SerializationOption, _ []uint8, _ []uint8) ([]uint8, int) { +func (_ ProcessingInstructionNode) SerializeWithFormat(_ SerializationOption, _ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -1979,21 +1732,15 @@ func (_ ProcessingInstructionNode) SetAttr(_ string, _ string) string { return "" } -func (_ ProcessingInstructionNode) SetChildren(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) SetChildren(_ interface{}) error { return nil } -func (_ ProcessingInstructionNode) SetContent(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) SetContent(_ interface{}) error { return nil } -func (_ ProcessingInstructionNode) SetInnerHtml(_ interface{}) interface { - Error() string -} { +func (_ ProcessingInstructionNode) SetInnerHtml(_ interface{}) error { return nil } @@ -2009,11 +1756,11 @@ func (_ ProcessingInstructionNode) String() string { return "" } -func (_ ProcessingInstructionNode) ToBuffer(_ []uint8) []uint8 { +func (_ ProcessingInstructionNode) ToBuffer(_ []byte) []byte { return nil } -func (_ ProcessingInstructionNode) ToHtml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ ProcessingInstructionNode) ToHtml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -2021,7 +1768,7 @@ func (_ ProcessingInstructionNode) ToUnformattedXml() string { return "" } -func (_ ProcessingInstructionNode) ToXml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ ProcessingInstructionNode) ToXml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -2035,9 +1782,7 @@ func (_ ProcessingInstructionNode) Uri() string { return "" } -func (_ ProcessingInstructionNode) Wrap(_ string) interface { - Error() string -} { +func (_ ProcessingInstructionNode) Wrap(_ string) error { return nil } @@ -2047,21 +1792,15 @@ type TextNode struct { XmlNode *XmlNode } -func (_ TextNode) AddChild(_ interface{}) interface { - Error() string -} { +func (_ TextNode) AddChild(_ interface{}) error { return nil } -func (_ TextNode) AddNextSibling(_ interface{}) interface { - Error() string -} { +func (_ TextNode) AddNextSibling(_ interface{}) error { return nil } -func (_ TextNode) AddPreviousSibling(_ interface{}) interface { - Error() string -} { +func (_ TextNode) AddPreviousSibling(_ interface{}) error { return nil } @@ -2085,9 +1824,7 @@ func (_ TextNode) Attributes() map[string]*AttributeNode { func (_ TextNode) BookkeepFragment(_ *DocumentFragment) {} -func (_ TextNode) Coerce(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ TextNode) Coerce(_ interface{}) ([]Node, error) { return nil, nil } @@ -2137,7 +1874,7 @@ func (_ TextNode) DocType() NodeType { return 0 } -func (_ TextNode) DocXPathCtx() *interface{} { +func (_ TextNode) DocXPathCtx() interface{} { return nil } @@ -2149,9 +1886,7 @@ func (_ TextNode) DuplicateTo(_ Document, _ int) Node { return nil } -func (_ TextNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, interface { - Error() string -}) { +func (_ TextNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, error) { return nil, nil } @@ -2169,31 +1904,23 @@ func (_ TextNode) InnerHtml() string { return "" } -func (_ TextNode) InputEncoding() []uint8 { +func (_ TextNode) InputEncoding() []byte { return nil } -func (_ TextNode) InsertAfter(_ interface{}) interface { - Error() string -} { +func (_ TextNode) InsertAfter(_ interface{}) error { return nil } -func (_ TextNode) InsertBefore(_ interface{}) interface { - Error() string -} { +func (_ TextNode) InsertBefore(_ interface{}) error { return nil } -func (_ TextNode) InsertBegin(_ interface{}) interface { - Error() string -} { +func (_ TextNode) InsertBegin(_ interface{}) error { return nil } -func (_ TextNode) InsertEnd(_ interface{}) interface { - Error() string -} { +func (_ TextNode) InsertEnd(_ interface{}) error { return nil } @@ -2237,7 +1964,7 @@ func (_ TextNode) NodeType() NodeType { return 0 } -func (_ TextNode) OutputEncoding() []uint8 { +func (_ TextNode) OutputEncoding() []byte { return nil } @@ -2245,9 +1972,7 @@ func (_ TextNode) Parent() Node { return nil } -func (_ TextNode) ParseFragment(_ []uint8, _ []uint8, _ ParseOption) (*DocumentFragment, interface { - Error() string -}) { +func (_ TextNode) ParseFragment(_ []byte, _ []byte, _ ParseOption) (*DocumentFragment, error) { return nil, nil } @@ -2259,9 +1984,7 @@ func (_ TextNode) PreviousSibling() Node { return nil } -func (_ TextNode) RecursivelyRemoveNamespaces() interface { - Error() string -} { +func (_ TextNode) RecursivelyRemoveNamespaces() error { return nil } @@ -2273,9 +1996,7 @@ func (_ TextNode) RemoveUnlinkedNode(_ interface{}) bool { return false } -func (_ TextNode) Replace(_ interface{}) interface { - Error() string -} { +func (_ TextNode) Replace(_ interface{}) error { return nil } @@ -2287,19 +2008,15 @@ func (_ TextNode) Root() *ElementNode { return nil } -func (_ TextNode) Search(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ TextNode) Search(_ interface{}) ([]Node, error) { return nil, nil } -func (_ TextNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, interface { - Error() string -}) { +func (_ TextNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, error) { return nil, nil } -func (_ TextNode) SerializeWithFormat(_ SerializationOption, _ []uint8, _ []uint8) ([]uint8, int) { +func (_ TextNode) SerializeWithFormat(_ SerializationOption, _ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -2307,21 +2024,15 @@ func (_ TextNode) SetAttr(_ string, _ string) string { return "" } -func (_ TextNode) SetChildren(_ interface{}) interface { - Error() string -} { +func (_ TextNode) SetChildren(_ interface{}) error { return nil } -func (_ TextNode) SetContent(_ interface{}) interface { - Error() string -} { +func (_ TextNode) SetContent(_ interface{}) error { return nil } -func (_ TextNode) SetInnerHtml(_ interface{}) interface { - Error() string -} { +func (_ TextNode) SetInnerHtml(_ interface{}) error { return nil } @@ -2337,11 +2048,11 @@ func (_ TextNode) String() string { return "" } -func (_ TextNode) ToBuffer(_ []uint8) []uint8 { +func (_ TextNode) ToBuffer(_ []byte) []byte { return nil } -func (_ TextNode) ToHtml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ TextNode) ToHtml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -2349,7 +2060,7 @@ func (_ TextNode) ToUnformattedXml() string { return "" } -func (_ TextNode) ToXml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ TextNode) ToXml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -2363,16 +2074,14 @@ func (_ TextNode) Uri() string { return "" } -func (_ TextNode) Wrap(_ string) interface { - Error() string -} { +func (_ TextNode) Wrap(_ string) error { return nil } func (_ *TextNode) DisableOutputEscaping() {} type XmlNode struct { - Ptr *interface{} + Ptr interface{} Document Document } @@ -2412,13 +2121,13 @@ func (_ XmlNode) DocType() NodeType { return 0 } -func (_ XmlNode) DocXPathCtx() *interface{} { +func (_ XmlNode) DocXPathCtx() interface{} { return nil } func (_ XmlNode) Free() {} -func (_ XmlNode) InputEncoding() []uint8 { +func (_ XmlNode) InputEncoding() []byte { return nil } @@ -2426,7 +2135,7 @@ func (_ XmlNode) NodeById(_ string) *ElementNode { return nil } -func (_ XmlNode) OutputEncoding() []uint8 { +func (_ XmlNode) OutputEncoding() []byte { return nil } @@ -2446,21 +2155,15 @@ func (_ XmlNode) Uri() string { return "" } -func (_ *XmlNode) AddChild(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) AddChild(_ interface{}) error { return nil } -func (_ *XmlNode) AddNextSibling(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) AddNextSibling(_ interface{}) error { return nil } -func (_ *XmlNode) AddPreviousSibling(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) AddPreviousSibling(_ interface{}) error { return nil } @@ -2480,9 +2183,7 @@ func (_ *XmlNode) Attributes() map[string]*AttributeNode { return nil } -func (_ *XmlNode) Coerce(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ *XmlNode) Coerce(_ interface{}) ([]Node, error) { return nil, nil } @@ -2508,9 +2209,7 @@ func (_ *XmlNode) DuplicateTo(_ Document, _ int) Node { return nil } -func (_ *XmlNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, interface { - Error() string -}) { +func (_ *XmlNode) EvalXPath(_ interface{}, _ interface{}) (interface{}, error) { return nil, nil } @@ -2526,27 +2225,19 @@ func (_ *XmlNode) InnerHtml() string { return "" } -func (_ *XmlNode) InsertAfter(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) InsertAfter(_ interface{}) error { return nil } -func (_ *XmlNode) InsertBefore(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) InsertBefore(_ interface{}) error { return nil } -func (_ *XmlNode) InsertBegin(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) InsertBegin(_ interface{}) error { return nil } -func (_ *XmlNode) InsertEnd(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) InsertEnd(_ interface{}) error { return nil } @@ -2590,9 +2281,7 @@ func (_ *XmlNode) Parent() Node { return nil } -func (_ *XmlNode) ParseFragment(_ []uint8, _ []uint8, _ ParseOption) (*DocumentFragment, interface { - Error() string -}) { +func (_ *XmlNode) ParseFragment(_ []byte, _ []byte, _ ParseOption) (*DocumentFragment, error) { return nil, nil } @@ -2604,9 +2293,7 @@ func (_ *XmlNode) PreviousSibling() Node { return nil } -func (_ *XmlNode) RecursivelyRemoveNamespaces() interface { - Error() string -} { +func (_ *XmlNode) RecursivelyRemoveNamespaces() error { return nil } @@ -2614,9 +2301,7 @@ func (_ *XmlNode) Remove() {} func (_ *XmlNode) RemoveDefaultNamespace() {} -func (_ *XmlNode) Replace(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) Replace(_ interface{}) error { return nil } @@ -2624,19 +2309,15 @@ func (_ *XmlNode) ResetChildren() {} func (_ *XmlNode) ResetNodePtr() {} -func (_ *XmlNode) Search(_ interface{}) ([]Node, interface { - Error() string -}) { +func (_ *XmlNode) Search(_ interface{}) ([]Node, error) { return nil, nil } -func (_ *XmlNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, interface { - Error() string -}) { +func (_ *XmlNode) SearchWithVariables(_ interface{}, _ interface{}) ([]Node, error) { return nil, nil } -func (_ *XmlNode) SerializeWithFormat(_ SerializationOption, _ []uint8, _ []uint8) ([]uint8, int) { +func (_ *XmlNode) SerializeWithFormat(_ SerializationOption, _ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -2644,21 +2325,15 @@ func (_ *XmlNode) SetAttr(_ string, _ string) string { return "" } -func (_ *XmlNode) SetChildren(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) SetChildren(_ interface{}) error { return nil } -func (_ *XmlNode) SetContent(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) SetContent(_ interface{}) error { return nil } -func (_ *XmlNode) SetInnerHtml(_ interface{}) interface { - Error() string -} { +func (_ *XmlNode) SetInnerHtml(_ interface{}) error { return nil } @@ -2674,11 +2349,11 @@ func (_ *XmlNode) String() string { return "" } -func (_ *XmlNode) ToBuffer(_ []uint8) []uint8 { +func (_ *XmlNode) ToBuffer(_ []byte) []byte { return nil } -func (_ *XmlNode) ToHtml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ *XmlNode) ToHtml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } @@ -2686,14 +2361,12 @@ func (_ *XmlNode) ToUnformattedXml() string { return "" } -func (_ *XmlNode) ToXml(_ []uint8, _ []uint8) ([]uint8, int) { +func (_ *XmlNode) ToXml(_ []byte, _ []byte) ([]byte, int) { return nil, 0 } func (_ *XmlNode) Unlink() {} -func (_ *XmlNode) Wrap(_ string) interface { - Error() string -} { +func (_ *XmlNode) Wrap(_ string) error { return nil } diff --git a/ql/test/query-tests/Security/CWE-643/vendor/github.com/jbowtie/gokogiri/xpath/stub.go b/ql/test/query-tests/Security/CWE-643/vendor/github.com/jbowtie/gokogiri/xpath/stub.go index 54f664cf2a1..c1e32cba5f2 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/github.com/jbowtie/gokogiri/xpath/stub.go +++ b/ql/test/query-tests/Security/CWE-643/vendor/github.com/jbowtie/gokogiri/xpath/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/jbowtie/gokogiri/xpath, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/jbowtie/gokogiri/xpath (exports: ; functions: Compile) // Package xpath is a stub of github.com/jbowtie/gokogiri/xpath, generated by depstubber. @@ -13,7 +14,7 @@ func Compile(_ string) *Expression { } type Expression struct { - Ptr *interface{} + Ptr interface{} } func (_ *Expression) Free() {} diff --git a/ql/test/query-tests/Security/CWE-643/vendor/github.com/santhosh-tekuri/xpathparser/stub.go b/ql/test/query-tests/Security/CWE-643/vendor/github.com/santhosh-tekuri/xpathparser/stub.go index 8f49df46c65..8bb9a6ced33 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/github.com/santhosh-tekuri/xpathparser/stub.go +++ b/ql/test/query-tests/Security/CWE-643/vendor/github.com/santhosh-tekuri/xpathparser/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/santhosh-tekuri/xpathparser, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/santhosh-tekuri/xpathparser (exports: ; functions: Parse,MustParse) // Package xpathparser is a stub of github.com/santhosh-tekuri/xpathparser, generated by depstubber. @@ -14,8 +15,6 @@ func MustParse(_ string) Expr { return nil } -func Parse(_ string) (Expr, interface { - Error() string -}) { +func Parse(_ string) (Expr, error) { return nil, nil } diff --git a/ql/test/query-tests/Security/CWE-643/vendor/modules.txt b/ql/test/query-tests/Security/CWE-643/vendor/modules.txt index c51bc8971fe..ce1e1188bf6 100644 --- a/ql/test/query-tests/Security/CWE-643/vendor/modules.txt +++ b/ql/test/query-tests/Security/CWE-643/vendor/modules.txt @@ -13,30 +13,12 @@ github.com/antchfx/xmlquery # github.com/antchfx/xpath v1.1.5 ## explicit github.com/antchfx/xpath -# github.com/github/depstubber v0.0.0-20200413231600-392d5a70208e -## explicit -github.com/github/depstubber # github.com/go-xmlpath/xmlpath v0.0.0-20150820204837-860cbeca3ebc ## explicit github.com/go-xmlpath/xmlpath -# github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e -## explicit -github.com/golang/groupcache # github.com/jbowtie/gokogiri v0.0.0-20190301021639-37f655d3078f ## explicit github.com/jbowtie/gokogiri -# github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e -## explicit -github.com/niemeyer/pretty # github.com/santhosh-tekuri/xpathparser v1.0.0 ## explicit github.com/santhosh-tekuri/xpathparser -# golang.org/x/net v0.0.0-20200226121028-0de0cce0169b -## explicit -golang.org/x/net -# gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f -## explicit -gopkg.in/check.v1 -# gopkg.in/xmlpath.v2 v2.0.0-20150820204837-860cbeca3ebc -## explicit -gopkg.in/xmlpath.v2 diff --git a/ql/test/query-tests/filters/ClassifyFiles/go.mod b/ql/test/query-tests/filters/ClassifyFiles/go.mod index 62ce60299b7..aa05800e200 100644 --- a/ql/test/query-tests/filters/ClassifyFiles/go.mod +++ b/ql/test/query-tests/filters/ClassifyFiles/go.mod @@ -3,10 +3,6 @@ module filters.ClassifyFiles go 1.14 require ( - github.com/github/depstubber v0.0.0-20200414033246-a63ca77a1581 // indirect github.com/onsi/ginkgo v1.12.0 github.com/onsi/gomega v1.9.0 - golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect - golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect - golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect ) diff --git a/ql/test/query-tests/filters/ClassifyFiles/vendor/modules.txt b/ql/test/query-tests/filters/ClassifyFiles/vendor/modules.txt index b17b7a8df2c..b7e13eca83b 100644 --- a/ql/test/query-tests/filters/ClassifyFiles/vendor/modules.txt +++ b/ql/test/query-tests/filters/ClassifyFiles/vendor/modules.txt @@ -1,18 +1,6 @@ -# github.com/github/depstubber v0.0.0-20200414033246-a63ca77a1581 -## explicit -github.com/github/depstubber # github.com/onsi/ginkgo v1.12.0 ## explicit github.com/onsi/ginkgo # github.com/onsi/gomega v1.9.0 ## explicit github.com/onsi/gomega -# golang.org/x/net v0.0.0-20200226121028-0de0cce0169b -## explicit -golang.org/x/net -# golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e -## explicit -golang.org/x/sync -# golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 -## explicit -golang.org/x/xerrors