-1

I had a variable payload, it is too long here just a part.

payload := strings.NewReader("json=%7B%22rent_content_layout%22%3A%22Original%22%2C%22start_verylargetext_enabled%22%3Afalse%2C%22auto_large_mode")


  

is any way to make the one line var data to multi line or make it human readable using golang, for bash or shell we use \n, is any trick to line break it using golang

Anas S
  • 63
  • 5
  • 4
    what do you mean you would use `\n`? Do you want to add newlines into the string? If you want to break up the long string, just do that and concatenate the parts with `+`. – JimB Aug 15 '22 at 17:25

1 Answers1

1

Simply do the string concatenation with the + operator and break the string into small parts.

payload := strings.NewReader(
        "json=%7B%22" +
        "rent_content_layout%22%3A%22" +
        "Original%22%2C%22" +
        "start_verylargetext_enabled%22%3A" +
        "false%2C%22auto_large_mode")
nipuna
  • 3,697
  • 11
  • 24