@@ -101,10 +101,40 @@ mux.Post("/register", ru.ServeHTTP)
101
101
` WriteHeader ` メソッド内の「` r.status = status ` 」を「` r.status = statusCode ` 」に修正。
102
102
[ @litencatt ] ( https://github.com/litencatt ) さん[ ご指摘] ( https://github.com/budougumi0617/go_todo_app/discussions/33 ) ありがとうございました(2022/08/15)
103
103
104
+
104
105
** P148 テストとコードカバレッジ取得の自動実行**
105
106
「GitHub Actiuons上で実行したテスト結果」ではなく、「GitHub Actions上で実行したテスト結果」に修正。
106
107
[ @kdnakt ] ( https://twitter.com/kdnakt ) さんご指摘ありがとうございました(2022/08/06)
107
108
109
+ ** P148 テストとコードカバレッジ取得の自動実行**
110
+ 「` .github/workflows/ ` ディレクトリ配下に` test.yml ` を作成します。」ではなく、「` .github/workflows/ ` ディレクトリ配下に` test.yml ` を作成します。また、ルートディレクトリに` .octocov.yml ` を作成します」に修正。
111
+ ` .octocov.yml ` のファイル内容は次のとおりです。
112
+ https://github.com/budougumi0617/go_todo_app/blob/v1.0.4/.octocov.yml
113
+ ``` yaml
114
+ coverage :
115
+ paths :
116
+ - coverage.out
117
+ codeToTestRatio :
118
+ code :
119
+ - ' **/*.go'
120
+ - ' !**/*_test.go'
121
+ test :
122
+ - ' **/*_test.go'
123
+ testExecutionTime :
124
+ if : true
125
+ diff :
126
+ datastores :
127
+ - artifact://${GITHUB_REPOSITORY}
128
+ comment :
129
+ if : is_pull_request
130
+ report :
131
+ if : is_default_branch
132
+ datastores :
133
+ - artifact://${GITHUB_REPOSITORY}
134
+ ` ` `
135
+
136
+ [@ac0mz](https://github.com/ac0mz)さん[ご指摘](https://github.com/budougumi0617/go_todo_app/discussions/43) ありがとうございました(2022/09/04)
137
+
108
138
109
139
**P163 リスト16.16 「httptest」パッケージを使った擬似的なHTTPリクエストのテスト**
110
140
「` {"status": " ok"}`」ではなく、「`{"status": "ok"}`」に修正。
@@ -134,6 +164,10 @@ if err != nil {
134
164
**P175 リスト17.8 ファイルを使った入出力の検証**
135
165
`Tasks : map[int]*entity.Task{},` ではなく、`Tasks: map[entity.TaskID]*entity.Task{},`に修正。(2022/08/06)
136
166
167
+ **P185 リスト18.4 MySQLコンテナの設定の追加前後を比較した「docker-compose.yml」の差分**
168
+ 「`TODO_DB_DATABASE : todo`」ではなく、「`TODO_DB_NAME: todo`」に修正。
169
+ [@ac0mz](https://github.com/ac0mz)さん[ご指摘](https://github.com/budougumi0617/go_todo_app/discussions/39) ありがとうございました(2022/09/04)
170
+
137
171
**P187 SECTION-072 MySQL実行環境の構築**
138
172
「GitHub Actionis上でMySQLコンテナを起動します。」ではなく、「GitHub Actions上でMySQLコンテナを起動します。」に修正。
139
173
「GitHub Actionisではサービスコンテナという方法で」ではなく、「GitHub Actionsではサービスコンテナという方法で」に修正。
@@ -150,10 +184,41 @@ if !bytes.Contains(rawPrivKey, want) {
150
184
}
151
185
` ` `
152
186
187
+ **P233 リスト20.14 「JWTer」構造体と初期化関数の定義**
188
+ 「`NewJWTer`」関数の実装を次のように修正。
189
+
190
+ ` ` ` go
191
+ func NewJWTer(s Store, c clock.Clocker) (*JWTer, error) {
192
+ j := &JWTer{Store: s}
193
+ privkey, err := parse(rawPrivKey)
194
+ if err != nil {
195
+ return nil, fmt.Errorf("failed in NewJWTer: private key: %w", err)
196
+ }
197
+ pubkey, err := parse(rawPubKey)
198
+ if err != nil {
199
+ return nil, fmt.Errorf("failed in NewJWTer: public key: %w", err)
200
+ }
201
+ j.PrivateKey = privkey
202
+ j.PublicKey = pubkey
203
+ j.Clocker = c
204
+ return j, nil
205
+ }
206
+ ` ` `
207
+
208
+ [@kdnakt](https://twitter.com/kdnakt)さん[ご指摘](https://github.com/budougumi0617/go_todo_app/discussions/44)ご指摘ありがとうございました(2022/09/04)
209
+
153
210
**P244 SECTION-085 ユーザーログインエンドポイントの実装**
154
211
「`LoginServiceインターフェースはauth/service.goに追記し,`」ではなく「`LoginServiceインターフェースはhandler/service.goに追記し,`」に修正。
155
212
[@manaty226](https://github.com/manaty226)さん[ご指摘](https://github.com/budougumi0617/go_todo_app/discussions/27)ご指摘ありがとうございました(2022/08/10)
156
213
157
214
**P250 リスト20.32 「POST /login」エンドポイントを追加する**
158
215
「`JWTer : jwter,`」ではなく、「`TokenGenerator: jwter,`」に修正。
159
- [ @yskgc ] ( https://github.com/yskgc ) さん[ ご指摘] ( https://github.com/budougumi0617/go_todo_app/discussions/31 ) ご指摘ありがとうございました(2022/08/12)
216
+ [@yskgc](https://github.com/yskgc)さん[ご指摘](https://github.com/budougumi0617/go_todo_app/discussions/31)ご指摘ありがとうございました(2022/08/12)
217
+
218
+ **P250 リスト20.32 「POST /login」エンドポイントを追加する**
219
+ 「`jwter, err := auth.NewJWTer(rcli)`」ではなく、「`jwter, err := auth.NewJWTer(rcli, clocker)`」に修正。
220
+ [@ac0mz](https://github.com/ac0mz)さん[ご指摘](https://github.com/budougumi0617/go_todo_app/discussions/44) ありがとうございました(2022/09/04)
221
+
222
+ **P262 「admin」ロールのユーザーのみがアクセス可能なエンドポイントを作成する**
223
+ 「ミドルウェアの適用順序に気をつけながら実装したのがapply_adminです。」ではなく、「ミドルウェアの適用順序に気をつけながら実装したのがリスト20.47の実装です。リスト20.47では、アクセストークンから`http.Request`型の値に含まれる`context.Context`型の値にユーザーIDとロールを埋め込む`handler.AuthMiddleware`が実行されたあとに`handler.AdminMiddleware`が実行され順序でミドルウェアを適用しています。」に修正・追記。
224
+ [@ac0mz](https://github.com/ac0mz)さん[ご指摘](https://github.com/budougumi0617/go_todo_app/discussions/45) ありがとうございました(2022/09/04)
0 commit comments