From 817e170ddd4028d05ec2647594895a7bf61c7d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Jim=C3=A9nez=20Pascual?= Date: Thu, 18 Jul 2024 14:45:06 +0200 Subject: [PATCH] Add complete example --- .gitignore | 1 - Makefile | 2 +- examples/library/compose.yml | 9 + .../pb/sqlc/examples/library/v1/author.sql | 30 +++ .../gen/pb/sqlc/examples/library/v1/book.sql | 37 ++++ .../library/internal/gen/pb/sqlc/schema.sql | 33 +++ .../library/internal/gen/sqlc/author.sql.go | 104 ++++++++++ .../library/internal/gen/sqlc/book.sql.go | 193 ++++++++++++++++++ examples/library/internal/gen/sqlc/db.go | 32 +++ examples/library/internal/gen/sqlc/models.go | 74 +++++++ examples/library/main.go | 113 ++++++++++ go.mod | 5 +- go.sum | 18 +- 13 files changed, 644 insertions(+), 7 deletions(-) create mode 100644 examples/library/compose.yml create mode 100644 examples/library/internal/gen/pb/sqlc/examples/library/v1/author.sql create mode 100644 examples/library/internal/gen/pb/sqlc/examples/library/v1/book.sql create mode 100644 examples/library/internal/gen/pb/sqlc/schema.sql create mode 100644 examples/library/internal/gen/sqlc/author.sql.go create mode 100644 examples/library/internal/gen/sqlc/book.sql.go create mode 100644 examples/library/internal/gen/sqlc/db.go create mode 100644 examples/library/internal/gen/sqlc/models.go create mode 100644 examples/library/main.go diff --git a/.gitignore b/.gitignore index bfdfbcd..7f6b22d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -examples/library/internal/gen tmp # Binaries for programs and plugins diff --git a/Makefile b/Makefile index 27ee477..fcd7330 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ sqlc: protoc ## push: push changes to the remote Git repository .PHONY: push -push: clean audit test/cover no-dirty +push: clean sqlc audit test/cover no-dirty git push ## clean: clean all generated artifacts diff --git a/examples/library/compose.yml b/examples/library/compose.yml new file mode 100644 index 0000000..26fcdb9 --- /dev/null +++ b/examples/library/compose.yml @@ -0,0 +1,9 @@ +services: + exampledb: + image: postgres + ports: + - 5432:5432 + environment: + - POSTGRES_PASSWORD=examplepassword + - POSTGRES_USER=exampleuser + - POSTGRES_DB=exampledb diff --git a/examples/library/internal/gen/pb/sqlc/examples/library/v1/author.sql b/examples/library/internal/gen/pb/sqlc/examples/library/v1/author.sql new file mode 100644 index 0000000..4bbf350 --- /dev/null +++ b/examples/library/internal/gen/pb/sqlc/examples/library/v1/author.sql @@ -0,0 +1,30 @@ +-- Code generated by protoc-gen-sqlc. DO NOT EDIT. +-- source: +-- examples/library/v1/author.proto +-- +-- name: GetAuthor :one +SELECT * FROM Author +WHERE author_id = $1 LIMIT 1; + +-- name: ListAuthor :many +SELECT * FROM Author +ORDER BY author_id; + +-- name: CreateAuthor :one +INSERT INTO Author ( + author_id, name, biography +) VALUES ( + $1, $2, $3 +) +RETURNING *; + +-- name: UpdateAuthor :one +UPDATE Author SET + name = $2, + biography = $3 +WHERE author_id = $1 +RETURNING *; + +-- name: DeleteAuthor :exec +DELETE FROM Author +WHERE author_id = $1; diff --git a/examples/library/internal/gen/pb/sqlc/examples/library/v1/book.sql b/examples/library/internal/gen/pb/sqlc/examples/library/v1/book.sql new file mode 100644 index 0000000..d9a74fc --- /dev/null +++ b/examples/library/internal/gen/pb/sqlc/examples/library/v1/book.sql @@ -0,0 +1,37 @@ +-- Code generated by protoc-gen-sqlc. DO NOT EDIT. +-- source: +-- examples/library/v1/book.proto +-- +-- name: GetBook :one +SELECT * FROM Book +WHERE book_id = $1 LIMIT 1; + +-- name: ListBook :many +SELECT * FROM Book +ORDER BY book_id; + +-- name: CreateBook :one +INSERT INTO Book ( + book_id, author_id, isbn, book_type, title, year, available_time, tags, published, price +) VALUES ( + $1, $2, $3, $4, $5, $6, $7, $8, $9, $10 +) +RETURNING *; + +-- name: UpdateBook :one +UPDATE Book SET + author_id = $2, + isbn = $3, + book_type = $4, + title = $5, + year = $6, + available_time = $7, + tags = $8, + published = $9, + price = $10 +WHERE book_id = $1 +RETURNING *; + +-- name: DeleteBook :exec +DELETE FROM Book +WHERE book_id = $1; diff --git a/examples/library/internal/gen/pb/sqlc/schema.sql b/examples/library/internal/gen/pb/sqlc/schema.sql new file mode 100644 index 0000000..26611ce --- /dev/null +++ b/examples/library/internal/gen/pb/sqlc/schema.sql @@ -0,0 +1,33 @@ +-- Code generated by protoc-gen-sqlc. DO NOT EDIT. +-- source: +-- + +CREATE TYPE BookType AS ENUM ( + 'BOOK_TYPE_UNSPECIFIED', + 'BOOK_TYPE_FICTION', + 'BOOK_TYPE_NONFICTION' +); + +CREATE TABLE Author ( + author_id INTEGER NOT NULL, + name TEXT NOT NULL DEFAULT 'Anonymous', + biography JSONB, + PRIMARY KEY(author_id) +); + +CREATE TABLE Book ( + book_id INTEGER NOT NULL, + author_id INTEGER NOT NULL, + isbn TEXT NOT NULL, + book_type BookType NOT NULL DEFAULT 'BOOK_TYPE_FICTION', + title TEXT NOT NULL DEFAULT 'Unknown', + year INTEGER NOT NULL DEFAULT 2000, + available_time TIMESTAMP NOT NULL DEFAULT 'NOW()', + tags TEXT[] NOT NULL DEFAULT '{}', + published BOOLEAN DEFAULT false, + price FLOAT, + PRIMARY KEY(book_id), + FOREIGN KEY(author_id) REFERENCES Author(author_id) ON DELETE CASCADE, + UNIQUE(isbn) +); + diff --git a/examples/library/internal/gen/sqlc/author.sql.go b/examples/library/internal/gen/sqlc/author.sql.go new file mode 100644 index 0000000..97f36f7 --- /dev/null +++ b/examples/library/internal/gen/sqlc/author.sql.go @@ -0,0 +1,104 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: author.sql + +package example + +import ( + "context" +) + +const createAuthor = `-- name: CreateAuthor :one +INSERT INTO Author ( + author_id, name, biography +) VALUES ( + $1, $2, $3 +) +RETURNING author_id, name, biography +` + +type CreateAuthorParams struct { + AuthorID int32 + Name string + Biography []byte +} + +func (q *Queries) CreateAuthor(ctx context.Context, arg CreateAuthorParams) (Author, error) { + row := q.db.QueryRow(ctx, createAuthor, arg.AuthorID, arg.Name, arg.Biography) + var i Author + err := row.Scan(&i.AuthorID, &i.Name, &i.Biography) + return i, err +} + +const deleteAuthor = `-- name: DeleteAuthor :exec +DELETE FROM Author +WHERE author_id = $1 +` + +func (q *Queries) DeleteAuthor(ctx context.Context, authorID int32) error { + _, err := q.db.Exec(ctx, deleteAuthor, authorID) + return err +} + +const getAuthor = `-- name: GetAuthor :one +SELECT author_id, name, biography FROM Author +WHERE author_id = $1 LIMIT 1 +` + +// Code generated by protoc-gen-sqlc. DO NOT EDIT. +// source: +// +// examples/library/v1/author.proto +func (q *Queries) GetAuthor(ctx context.Context, authorID int32) (Author, error) { + row := q.db.QueryRow(ctx, getAuthor, authorID) + var i Author + err := row.Scan(&i.AuthorID, &i.Name, &i.Biography) + return i, err +} + +const listAuthor = `-- name: ListAuthor :many +SELECT author_id, name, biography FROM Author +ORDER BY author_id +` + +func (q *Queries) ListAuthor(ctx context.Context) ([]Author, error) { + rows, err := q.db.Query(ctx, listAuthor) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Author + for rows.Next() { + var i Author + if err := rows.Scan(&i.AuthorID, &i.Name, &i.Biography); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const updateAuthor = `-- name: UpdateAuthor :one +UPDATE Author SET + name = $2, + biography = $3 +WHERE author_id = $1 +RETURNING author_id, name, biography +` + +type UpdateAuthorParams struct { + AuthorID int32 + Name string + Biography []byte +} + +func (q *Queries) UpdateAuthor(ctx context.Context, arg UpdateAuthorParams) (Author, error) { + row := q.db.QueryRow(ctx, updateAuthor, arg.AuthorID, arg.Name, arg.Biography) + var i Author + err := row.Scan(&i.AuthorID, &i.Name, &i.Biography) + return i, err +} diff --git a/examples/library/internal/gen/sqlc/book.sql.go b/examples/library/internal/gen/sqlc/book.sql.go new file mode 100644 index 0000000..f87e0fe --- /dev/null +++ b/examples/library/internal/gen/sqlc/book.sql.go @@ -0,0 +1,193 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: book.sql + +package example + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createBook = `-- name: CreateBook :one +INSERT INTO Book ( + book_id, author_id, isbn, book_type, title, year, available_time, tags, published, price +) VALUES ( + $1, $2, $3, $4, $5, $6, $7, $8, $9, $10 +) +RETURNING book_id, author_id, isbn, book_type, title, year, available_time, tags, published, price +` + +type CreateBookParams struct { + BookID int32 + AuthorID int32 + Isbn string + BookType Booktype + Title string + Year int32 + AvailableTime pgtype.Timestamp + Tags []string + Published pgtype.Bool + Price pgtype.Float8 +} + +func (q *Queries) CreateBook(ctx context.Context, arg CreateBookParams) (Book, error) { + row := q.db.QueryRow(ctx, createBook, + arg.BookID, + arg.AuthorID, + arg.Isbn, + arg.BookType, + arg.Title, + arg.Year, + arg.AvailableTime, + arg.Tags, + arg.Published, + arg.Price, + ) + var i Book + err := row.Scan( + &i.BookID, + &i.AuthorID, + &i.Isbn, + &i.BookType, + &i.Title, + &i.Year, + &i.AvailableTime, + &i.Tags, + &i.Published, + &i.Price, + ) + return i, err +} + +const deleteBook = `-- name: DeleteBook :exec +DELETE FROM Book +WHERE book_id = $1 +` + +func (q *Queries) DeleteBook(ctx context.Context, bookID int32) error { + _, err := q.db.Exec(ctx, deleteBook, bookID) + return err +} + +const getBook = `-- name: GetBook :one +SELECT book_id, author_id, isbn, book_type, title, year, available_time, tags, published, price FROM Book +WHERE book_id = $1 LIMIT 1 +` + +// Code generated by protoc-gen-sqlc. DO NOT EDIT. +// source: +// +// examples/library/v1/book.proto +func (q *Queries) GetBook(ctx context.Context, bookID int32) (Book, error) { + row := q.db.QueryRow(ctx, getBook, bookID) + var i Book + err := row.Scan( + &i.BookID, + &i.AuthorID, + &i.Isbn, + &i.BookType, + &i.Title, + &i.Year, + &i.AvailableTime, + &i.Tags, + &i.Published, + &i.Price, + ) + return i, err +} + +const listBook = `-- name: ListBook :many +SELECT book_id, author_id, isbn, book_type, title, year, available_time, tags, published, price FROM Book +ORDER BY book_id +` + +func (q *Queries) ListBook(ctx context.Context) ([]Book, error) { + rows, err := q.db.Query(ctx, listBook) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Book + for rows.Next() { + var i Book + if err := rows.Scan( + &i.BookID, + &i.AuthorID, + &i.Isbn, + &i.BookType, + &i.Title, + &i.Year, + &i.AvailableTime, + &i.Tags, + &i.Published, + &i.Price, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const updateBook = `-- name: UpdateBook :one +UPDATE Book SET + author_id = $2, + isbn = $3, + book_type = $4, + title = $5, + year = $6, + available_time = $7, + tags = $8, + published = $9, + price = $10 +WHERE book_id = $1 +RETURNING book_id, author_id, isbn, book_type, title, year, available_time, tags, published, price +` + +type UpdateBookParams struct { + BookID int32 + AuthorID int32 + Isbn string + BookType Booktype + Title string + Year int32 + AvailableTime pgtype.Timestamp + Tags []string + Published pgtype.Bool + Price pgtype.Float8 +} + +func (q *Queries) UpdateBook(ctx context.Context, arg UpdateBookParams) (Book, error) { + row := q.db.QueryRow(ctx, updateBook, + arg.BookID, + arg.AuthorID, + arg.Isbn, + arg.BookType, + arg.Title, + arg.Year, + arg.AvailableTime, + arg.Tags, + arg.Published, + arg.Price, + ) + var i Book + err := row.Scan( + &i.BookID, + &i.AuthorID, + &i.Isbn, + &i.BookType, + &i.Title, + &i.Year, + &i.AvailableTime, + &i.Tags, + &i.Published, + &i.Price, + ) + return i, err +} diff --git a/examples/library/internal/gen/sqlc/db.go b/examples/library/internal/gen/sqlc/db.go new file mode 100644 index 0000000..649ce3f --- /dev/null +++ b/examples/library/internal/gen/sqlc/db.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 + +package example + +import ( + "context" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/examples/library/internal/gen/sqlc/models.go b/examples/library/internal/gen/sqlc/models.go new file mode 100644 index 0000000..1b75669 --- /dev/null +++ b/examples/library/internal/gen/sqlc/models.go @@ -0,0 +1,74 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 + +package example + +import ( + "database/sql/driver" + "fmt" + + "github.com/jackc/pgx/v5/pgtype" +) + +type Booktype string + +const ( + BooktypeBOOKTYPEUNSPECIFIED Booktype = "BOOK_TYPE_UNSPECIFIED" + BooktypeBOOKTYPEFICTION Booktype = "BOOK_TYPE_FICTION" + BooktypeBOOKTYPENONFICTION Booktype = "BOOK_TYPE_NONFICTION" +) + +func (e *Booktype) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = Booktype(s) + case string: + *e = Booktype(s) + default: + return fmt.Errorf("unsupported scan type for Booktype: %T", src) + } + return nil +} + +type NullBooktype struct { + Booktype Booktype + Valid bool // Valid is true if Booktype is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullBooktype) Scan(value interface{}) error { + if value == nil { + ns.Booktype, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.Booktype.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullBooktype) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.Booktype), nil +} + +type Author struct { + AuthorID int32 + Name string + Biography []byte +} + +type Book struct { + BookID int32 + AuthorID int32 + Isbn string + BookType Booktype + Title string + Year int32 + AvailableTime pgtype.Timestamp + Tags []string + Published pgtype.Bool + Price pgtype.Float8 +} diff --git a/examples/library/main.go b/examples/library/main.go new file mode 100644 index 0000000..5860201 --- /dev/null +++ b/examples/library/main.go @@ -0,0 +1,113 @@ +// SPDX-FileCopyrightText: 2024 Pablo Jiménez Pascual +// +// SPDX-License-Identifier: BSD-3-Clause + +package main + +import ( + "context" + "embed" + "io/fs" + "log" + "reflect" + "time" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgtype" + example "github.com/pablojimpas/protoc-gen-sqlc/examples/library/internal/gen/sqlc" +) + +//go:embed internal/gen/pb/sqlc/schema.sql +var schemaFS embed.FS + +func run() error { + ctx := context.Background() + + conn, err := pgx.Connect(ctx, "postgresql://exampleuser:examplepassword@localhost/exampledb") + if err != nil { + return err + } + defer conn.Close(ctx) + + queries := example.New(conn) + + buf, err := fs.ReadFile(schemaFS, "internal/gen/pb/sqlc/schema.sql") + if err != nil { + return err + } + conn.Exec(ctx, string(buf)) + + // list all authors + authors, err := queries.ListAuthor(ctx) + if err != nil { + return err + } + log.Println("Authors list:") + log.Println(authors) + + bob, err := queries.CreateAuthor(ctx, example.CreateAuthorParams{ + Name: "Uncle Bob", + AuthorID: 5, + }) + if err != nil { + return err + } + + // create an author + insertedAuthor, err := queries.CreateAuthor(ctx, example.CreateAuthorParams{ + Name: "Brian Kernighan", + AuthorID: 11, + }) + if err != nil { + return err + } + log.Println("Inserted Author:") + log.Println(insertedAuthor) + + // list all authors + authors, err = queries.ListAuthor(ctx) + if err != nil { + return err + } + log.Println("Authors list:") + log.Println(authors) + + // get the author we just inserted + fetchedAuthor, err := queries.GetAuthor(ctx, insertedAuthor.AuthorID) + if err != nil { + return err + } + + log.Println("Inserted Author == Fetched Author:") + log.Println(reflect.DeepEqual(insertedAuthor, fetchedAuthor)) + + book, _ := queries.CreateBook(ctx, example.CreateBookParams{ + BookID: 1, + AuthorID: fetchedAuthor.AuthorID, + Isbn: "ABC123", + BookType: example.BooktypeBOOKTYPENONFICTION, + Title: "The C Programming Language", + Year: 1983, + AvailableTime: pgtype.Timestamp{Time: time.Now(), Valid: true}, + Tags: []string{"programming", "c"}, + Published: pgtype.Bool{Bool: true, Valid: true}, + Price: pgtype.Float8{Float64: 19.99, Valid: true}, + }) + log.Println("Inserted book") + log.Println(book) + + if err = queries.DeleteAuthor(ctx, bob.AuthorID); err != nil { + return err + } + if err = queries.DeleteAuthor(ctx, insertedAuthor.AuthorID); err != nil { + return nil + } + + return nil +} + +func main() { + if err := run(); err != nil { + log.Fatal(err) + } +} diff --git a/go.mod b/go.mod index 5fdc111..76e6d6e 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.22.4 require ( buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240508200655-46a4cf4ba109.2 github.com/Masterminds/sprig/v3 v3.2.3 + github.com/jackc/pgx/v5 v5.6.0 google.golang.org/protobuf v1.34.2 ) @@ -14,10 +15,12 @@ require ( github.com/google/uuid v1.1.1 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.11 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/cast v1.3.1 // indirect - github.com/stretchr/testify v1.8.1 // indirect golang.org/x/crypto v0.17.0 // indirect + golang.org/x/text v0.14.0 // indirect ) diff --git a/go.sum b/go.sum index e61a3a4..fd1e06f 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,14 @@ github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4 github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.6.0 h1:SWJzexBzPL5jb0GEsrPMLIsi/3jOo7RHlzTjcAeDrPY= +github.com/jackc/pgx/v5 v5.6.0/go.mod h1:DNZ/vlrUnhWCoFGxHAG8U2ljioxukquj7utPDgtQdTw= +github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= +github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= @@ -28,12 +36,10 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -49,6 +55,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -62,6 +70,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=