From 5ca0755b519d8d5686eb6a22c03c689c2933e5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Sun, 2 Jul 2023 21:06:15 +0200 Subject: [PATCH] codegen: use standard header for generated files Use the standard header in generated Go sources. See https://go.dev/s/generatedcode. --- README.md | 2 +- _codegen/main.go | 6 ++---- assert/assertion_format.go | 5 +---- assert/assertion_forward.go | 5 +---- require/require.go | 5 +---- require/require_forward.go | 5 +---- 6 files changed, 7 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 2c4468efb..d007c0616 100644 --- a/README.md +++ b/README.md @@ -359,7 +359,7 @@ Please feel free to submit issues, fork the repository and send pull requests! When submitting an issue, we ask that you please include a complete test function that demonstrates the issue. Extra credit for those using Testify to write the test code that demonstrates it. -Code generation is used. Look for `CODE GENERATED AUTOMATICALLY` at the top of some files. Run `go generate ./...` to update generated files. +Code generation is used. [Look for `Code generated with`](https://github.com/search?q=repo%3Astretchr%2Ftestify%20%22Code%20generated%20with%22&type=code) at the top of some files. Run `go generate ./...` to update generated files. We also chat on the [Gophers Slack](https://gophers.slack.com) group in the `#testify` and `#testify-dev` channels. diff --git a/_codegen/main.go b/_codegen/main.go index 079c3b575..11cdbfbc6 100644 --- a/_codegen/main.go +++ b/_codegen/main.go @@ -297,10 +297,8 @@ func (f *testFunc) CommentWithoutT(receiver string) string { return strings.Replace(f.Comment(), search, replace, -1) } -var headerTemplate = `/* -* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen -* THIS FILE MUST NOT BE EDITED BY HAND -*/ +// Standard header https://go.dev/s/generatedcode. +var headerTemplate = `// Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT. package {{.Name}} diff --git a/assert/assertion_format.go b/assert/assertion_format.go index 84dbd6c79..4b1d5e1e1 100644 --- a/assert/assertion_format.go +++ b/assert/assertion_format.go @@ -1,7 +1,4 @@ -/* -* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen -* THIS FILE MUST NOT BE EDITED BY HAND - */ +// Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT. package assert diff --git a/assert/assertion_forward.go b/assert/assertion_forward.go index b1d94aec5..4696f3032 100644 --- a/assert/assertion_forward.go +++ b/assert/assertion_forward.go @@ -1,7 +1,4 @@ -/* -* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen -* THIS FILE MUST NOT BE EDITED BY HAND - */ +// Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT. package assert diff --git a/require/require.go b/require/require.go index 63f852147..29b02fb7f 100644 --- a/require/require.go +++ b/require/require.go @@ -1,7 +1,4 @@ -/* -* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen -* THIS FILE MUST NOT BE EDITED BY HAND - */ +// Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT. package require diff --git a/require/require_forward.go b/require/require_forward.go index 3b5b09330..747521561 100644 --- a/require/require_forward.go +++ b/require/require_forward.go @@ -1,7 +1,4 @@ -/* -* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen -* THIS FILE MUST NOT BE EDITED BY HAND - */ +// Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT. package require