[Solved] How to convert byte type value to int type value


You can use the following approach

For Example

package main

import (
    "fmt"
    "strconv"
)

func main() {
    str := []byte("0125")
    aByteToInt, _ := strconv.Atoi(string(str))
    fmt.Println(aByteToInt)
}

You can run following code here https://play.golang.org/p/iq8Q9PkhM43

solved How to convert byte type value to int type value