Variable t2 has no newline in its value.

On Fri, Aug 21, 2020, 18:01 'Guilherme Dalmarco' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> Why *bytes.IndexByte *can not find '\n' in multiline string?
>
> package main
>
> import (
> "bytes"
> "fmt"
> )
>
> func main() {
> t1 := []byte("TEST\n")
> t2 := []byte(`TEST\n`)
> t3 := byte('\n')
>
> fmt.Println(t1)
> fmt.Println(t2)
> fmt.Println(t3)
>
> fmt.Println(bytes.IndexByte(t1, t3))
> fmt.Println(bytes.IndexByte(t2, t3))
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/925e3a5a-0775-44a4-8428-42b077a6be1dn%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/925e3a5a-0775-44a4-8428-42b077a6be1dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-VCDxeLJSDBvGuZzZyii5TBVsu_ZNH4Y%2BuAP_fyYE27Lg%40mail.gmail.com.

Reply via email to