mirror of
https://github.com/MADTeacher/go_basics.git
synced 2025-11-23 21:34:47 +02:00
15 lines
222 B
Go
15 lines
222 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
str1 := "hello"
|
|
fmt.Println(str1) // hello
|
|
|
|
byteArray := []byte(str1)
|
|
fmt.Println(byteArray) // [104 101 108 108 111]
|
|
|
|
str2 := string(byteArray)
|
|
fmt.Println(str2) // hello
|
|
}
|