You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Printf("Read %d bytes from %q", len(in), path)
192
204
193
205
out, err:=update(in)
194
206
iferr!=nil {
195
207
returnerr
196
208
}
197
209
198
210
ifbytes.Equal(in, out) {
199
-
log.Printf("Do nothing because there is no update in %q", p)
211
+
log.Printf("Do nothing because there is no update in %q", path)
200
212
returnnil
201
213
}
202
214
203
-
log.Printf("Generate the updated content (%d bytes) for %q", len(out), p)
204
-
iferr:=os.WriteFile(p, out, 0666); err!=nil {
215
+
ifcheck {
216
+
returnerrors.New("checks document has some update. run `go run ./scripts/update-checks-doc ./docs/checks.md` and commit the changes. the diff:\n\n"+cmp.Diff(in, out))
217
+
}
218
+
219
+
log.Printf("Generate the updated content (%d bytes) for %q", len(out), path)
0 commit comments