Check out example codes for "go int array move position". It will help you in understanding the concepts better.

Code Example 1

//go int array move given position
//Input
//1
//5 2
//1 2 3 4 5
//Output
//4 5 1 2 3
package main
import "fmt"
func main(){
    var t,i,j,k,n,x uint32=0,0,0,0,0,0
    fmt.Scan(&t)
    for i=0;i<t;i++{
        n,k=0,0
        fmt.Scan(&n,&k)
        a:=make([]uint32,n)
        for i=0;i<n;i++{fmt.Scanf("%v",&a[i])}
        for i=0;i<k;i++{
            x=a[n-1]
            for j=n-1;j>0;j--{a[j]=a[j-1]}
            a[0]=x
        }
        for i=0;i<n;i++{fmt.Printf("%v ",a[i])}
    }
}

Learn ReactJs, React Native from akashmittal.com