Selection sort algorithm with increasing/decreasing sort options
There are a few things I would point out as being poor go style. The two different nesting loops is where I would start:


for i := range A {
    for j := i + 1; j &lt; len(A); j++ {



The outer loop does a index-only range on the A slice, which in itself is not a problem, but logically it is for i := 0; i &lt; len(A); i++ {. Again, this is not really a problem, other than the fact that you are looping the indexes of the slice. The problem is that in your inner loop, you make that index-loop obvious with the full-syntax loop.

I would be tempted to use a full loop for the outer loop so that the index  functions on i and j are obvious.

The other thing I would suggest is that you supply a function for the S parameter, instead of a string.

While mentioning parameters, it is not common practice to use upper-case parameter names. These parameters are never exported, so should be lower-case initial, and mixedCase for multi-word names.

If you supply a function for the sort order, then your sort function is improved as well. Consider:

func SelectionSort(data []int, ordered func(int, int) bool) []int {
    for i := 0; i &lt; len(data); i++ {
        for j := i + 1; j &lt; len(data); j++ {
            if !ordered(data[i], data[j]) {
                data[i], data[j] = data[j], data[i]
            }
        }
    }
    return data
}


Now, you can call that code with something like:

increasing := func(a, b int) bool {
    return a &lt;= b
}

decreasing := func(a, b int) bool {
    return a &gt; b
}

data := []int{31, 41, 59, 26, 41, 58}
fmt.Println("Increasing sort array: ", SelectionSort(data, increasing))
....