How to transfer uint8 to int

guys, I read the color code of the picture through imgo :

height := imgo.GetImageHeight(img)       //   [height]
width := imgo.GetImageWidth(img)      //   [width]
imgMatrix := imgo.MustRead("F:\\GOPATH\\src\\code\\img\\hsq.jpg")
for starty := 0; starty < height; startyPP {
    for startx := 0; startx < width; startxPP {
        C := imgMatrix[starty][startx][0:3]
        R := imgMatrix[starty][startx][0] // R
        G := imgMatrix[starty][startx][1] // G
        B := imgMatrix[starty][startx][2] // B
    }
}

print out RCompGBank B and find that it is of uint8 type. I want to transfer it to int type and ask how to transfer it. Beginners ask for advice.

Jan.23,2022

The size of the

uint8 will not exceed the size of the int, direct cast.

package main

import "fmt"

func main() {
    var x uint8 = 255
    y := int(x)

    fmt.Println(y)
}

// 
//   go run x.go
// 255
Menu