convox / convox

Using a deprecated function, variable, constant or field GO-W1009
Anti-pattern
Major
15 hours 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.
  4	"bytes"
  5	"fmt"
  6	"io"
  7	"io/ioutil"  8	"math/rand"
  9	"strconv"
 10
"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.
 2
 3import (
 4	"encoding/json"
 5	"io/ioutil" 6
 7	"github.com/convox/stdsdk"
 8)
e.Stream is deprecated: use StreamWithContext instead to avoid possible resource leaks. See https://github.com/kubernetes/kubernetes/pull/103177 for details.
 97		sopts.TerminalSizeQueue = &terminalSize{Height: *opts.Height, Width: *opts.Width}
 98	}
 99
100	err = e.Stream(sopts)101	if ee, ok := err.(exec.ExitError); ok {
102		return ee.ExitStatus(), nil
103	}
exec.Stream is deprecated: use StreamWithContext instead to avoid possible resource leaks. See https://github.com/kubernetes/kubernetes/pull/103177 for details.
78		return errors.WithStack(err)
79	}
80
81	if err := exec.Stream(remotecommand.StreamOptions{Stdin: r}); err != nil {82		return errors.WithStack(err)
83	}
84
exec.Stream is deprecated: use StreamWithContext instead to avoid possible resource leaks. See https://github.com/kubernetes/kubernetes/pull/103177 for details.
55	r, w := io.Pipe()
56
57	go func() {
58		exec.Stream(remotecommand.StreamOptions{Stdout: w})59		w.Close()
60	}()
61