Using a deprecated function, variable, constant or field GO-W1009
Anti-pattern
Major
5 months agoa year old
"io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details.
 12	"compress/gzip"
 13	"fmt"
 14	"io"
 15	"io/ioutil" 16	"os"
 17	"path/filepath"
 18	"strings"
recorder.HeaderMap has been deprecated since Go 1.11 and an alternative has been available since Go 1.7: HeaderMap exists for historical compatibility and should not be used. To access the headers returned by a handler, use the Response.Header map as returned by the Result method.
167	r, _ := http.NewRequest("PUT", "/foo", nil)
168	handler.ServeHTTP(recorder, r)
169
170	headersVal := recorder.HeaderMap.Get(headerAllowHeaders)171	if headersVal != "Origin,Accept,Content-Type,Authorization" {
172		t.Errorf("Allow-Headers is expected to be Origin,Accept,Content-Type,Authorization; found %v", headersVal)
173	}
recorder.HeaderMap has been deprecated since Go 1.11 and an alternative has been available since Go 1.7: HeaderMap exists for historical compatibility and should not be used. To access the headers returned by a handler, use the Response.Header map as returned by the Result method.
131	methodsVal := recorder.HeaderMap.Get(headerAllowMethods)
132	headersVal := recorder.HeaderMap.Get(headerAllowHeaders)
133	exposedHeadersVal := recorder.HeaderMap.Get(headerExposeHeaders)
134	maxAgeVal := recorder.HeaderMap.Get(headerMaxAge)135
136	if credentialsVal != "true" {
137		t.Errorf("Allow-Credentials is expected to be true, found %v", credentialsVal)
recorder.HeaderMap has been deprecated since Go 1.11 and an alternative has been available since Go 1.7: HeaderMap exists for historical compatibility and should not be used. To access the headers returned by a handler, use the Response.Header map as returned by the Result method.
130	credentialsVal := recorder.HeaderMap.Get(headerAllowCredentials)
131	methodsVal := recorder.HeaderMap.Get(headerAllowMethods)
132	headersVal := recorder.HeaderMap.Get(headerAllowHeaders)
133	exposedHeadersVal := recorder.HeaderMap.Get(headerExposeHeaders)134	maxAgeVal := recorder.HeaderMap.Get(headerMaxAge)
135
136	if credentialsVal != "true" {
recorder.HeaderMap has been deprecated since Go 1.11 and an alternative has been available since Go 1.7: HeaderMap exists for historical compatibility and should not be used. To access the headers returned by a handler, use the Response.Header map as returned by the Result method.
129
130	credentialsVal := recorder.HeaderMap.Get(headerAllowCredentials)
131	methodsVal := recorder.HeaderMap.Get(headerAllowMethods)
132	headersVal := recorder.HeaderMap.Get(headerAllowHeaders)133	exposedHeadersVal := recorder.HeaderMap.Get(headerExposeHeaders)
134	maxAgeVal := recorder.HeaderMap.Get(headerMaxAge)
135