From 02ebceac4526ab22ba9413634cdcfe396dddc333 Mon Sep 17 00:00:00 2001 From: Aditya Patil Date: Fri, 23 Jun 2023 14:24:54 +0530 Subject: [PATCH] #770 Issue. Updated: decisions.md, updated: best-practices.md --- go/best-practices.md | 4 ++-- go/decisions.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go/best-practices.md b/go/best-practices.md index 46c6148..5d9d143 100644 --- a/go/best-practices.md +++ b/go/best-practices.md @@ -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. diff --git a/go/decisions.md b/go/decisions.md index 8c842e9..1a43629 100644 --- a/go/decisions.md +++ b/go/decisions.md @@ -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) }