INNER CODE UNIT · Go
Test_GetLicenseKey_FromFileTrimsWhitespace_JWT
inlets/inlets-operator · config_test.go:56
func Test_GetLicenseKey_FromFileTrimsWhitespace_JWT(t *testing.T) {
want := `static.key.text`
tmp := os.TempDir()
f, err := os.CreateTemp(tmp, "test-license-with-newline.txt")
if err != nil {
t.Fatal(err)
}
name := f.Name()
// Add a new line at the beginning of the text, and one
// at the end
f.Write([]byte(fmt.Sprintf("\n%s\n", want)))
f.Close()
defer os.Remove(name)
c := TunnelConfig{