From e71b7604ca0a8ce63336e512d4294f9565602844 Mon Sep 17 00:00:00 2001 From: Nasrul Faizin Date: Wed, 30 Jun 2021 18:33:16 +0700 Subject: [PATCH 1/2] fix codeblock on documentation --- sqlstruct.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sqlstruct.go b/sqlstruct.go index bd9756b..385801b 100644 --- a/sqlstruct.go +++ b/sqlstruct.go @@ -52,10 +52,10 @@ by the same alias, using the ColumnsAliased and ScanAliased functions: var user User var address Address sql := ` -SELECT %s, %s FROM users AS u -INNER JOIN address AS a ON a.id = u.address_id -WHERE u.username = ? -` + SELECT %s, %s FROM users AS u + INNER JOIN address AS a ON a.id = u.address_id + WHERE u.username = ? + ` sql = fmt.Sprintf(sql, sqlstruct.ColumnsAliased(*user, "u"), sqlstruct.ColumnsAliased(*address, "a")) rows, err := db.Query(sql, "gedi") if err != nil { From d6ebbf6061c076c7c0d69cb40aabbf7b11d933e9 Mon Sep 17 00:00:00 2001 From: Nasrul Faizin Date: Wed, 30 Jun 2021 18:35:53 +0700 Subject: [PATCH 2/2] change tab to space --- sqlstruct.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sqlstruct.go b/sqlstruct.go index 385801b..2fa727e 100644 --- a/sqlstruct.go +++ b/sqlstruct.go @@ -52,10 +52,10 @@ by the same alias, using the ColumnsAliased and ScanAliased functions: var user User var address Address sql := ` - SELECT %s, %s FROM users AS u - INNER JOIN address AS a ON a.id = u.address_id - WHERE u.username = ? - ` + SELECT %s, %s FROM users AS u + INNER JOIN address AS a ON a.id = u.address_id + WHERE u.username = ? + ` sql = fmt.Sprintf(sql, sqlstruct.ColumnsAliased(*user, "u"), sqlstruct.ColumnsAliased(*address, "a")) rows, err := db.Query(sql, "gedi") if err != nil {