From aa308ffc35a74fd756a1b1cb933e551482865ea1 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 21 May 2021 13:35:17 -0700 Subject: [PATCH] Revert 2ed870fe5e113c5d3bb8fd201ba788c2489f5c94...8ae911896116ac337ad0ed5730e59b3db277d3c6 on InterfaceSlice --- InterfaceSlice.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InterfaceSlice.md b/InterfaceSlice.md index 51421f90..51ad38f8 100644 --- a/InterfaceSlice.md +++ b/InterfaceSlice.md @@ -36,7 +36,7 @@ If you really want a ` []interface{} ` because you'll be doing indexing before c ```go var dataSlice []int = foo() var interfaceSlice []interface{} = make([]interface{}, len(dataSlice)) -for i := range dataSlice { - interfaceSlice[i] = dataSlice[i] +for i, d := range dataSlice { + interfaceSlice[i] = d } ``` \ No newline at end of file