mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
#770 Issue. Updated: decisions.md, updated: best-practices.md
This commit is contained in:
parent
2173b8d68c
commit
02ebceac45
|
@ -1255,7 +1255,7 @@ information to the reader:
|
|||
// string.
|
||||
//
|
||||
// format is the format, and data is the interpolation data.
|
||||
func Sprintf(format string, data ...interface{}) string
|
||||
func Sprintf(format string, data ...any) string
|
||||
```
|
||||
|
||||
However, this snippet demonstrates a code scenario similar to the previous where
|
||||
|
@ -1272,7 +1272,7 @@ reader:
|
|||
// the format specification, the function will inline warnings about formatting
|
||||
// errors into the output string as described by the Format errors section
|
||||
// above.
|
||||
func Sprintf(format string, data ...interface{}) string
|
||||
func Sprintf(format string, data ...any) string
|
||||
```
|
||||
|
||||
Consider your likely audience in choosing what to document and at what depth.
|
||||
|
|
|
@ -2978,7 +2978,7 @@ right:
|
|||
// Bad:
|
||||
package assert
|
||||
|
||||
func IsNotNil(t *testing.T, name string, val interface{}) {
|
||||
func IsNotNil(t *testing.T, name string, val any) {
|
||||
if val == nil {
|
||||
t.Fatalf("data %s = nil, want not nil", name)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user