Skip to content

Converting to bytes #11

Open
Open
@Elara6331

Description

Describe the bug
Converting to bytes in python attempts to run a non-existent function bytes.

Python code example

def main():
	x = bytes("hello", "utf8")
	print(x[0])

if __name__ == '__main__':
  main()

Current behavior

package main

import "fmt"

func main() {
	x := bytes("hello", "utf8")
	fmt.Println(x[0])
}

Expected behavior
I expected the string to be converted to []byte

Go code example

package main

import "fmt"

func main() {
	x := []byte("hello")
	fmt.Println(x[0])
}

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions