# IntsAreSorted function in GO language program

Today, We want to share with you IntsAreSorted function in GO language program.In this post we will show you Sort Functions for integer, strings and float64 data type, hear for Golang Slice Sort, Reverse, Search Functions we will give you demo and example for implement.In this post, we will learn about src/sort/sort.go – The Go Programming Language with an example.

Free Live Chat for Any Issue

## IntsAreSorted function in GO language program

Contents

There are the Following The simple About IntsAreSorted function in GO language program Full Information With Example and source code.

As I will cover this Post with live Working example to develop golang compare strings alphabetically, so the Golang IntsAreSorted function for this example is following below.

Also Read This π   Simple Angular 6 Observables Example

### Top 7 Golang Program

The Go lang IntsAreSorted methods or function simple data tests whether a slice of value integer is sorted in ascending order. and then this function returns true value if the slice of numbers is fetch in the ascending order, as well as other condtions false otherwise.

Go program Syntax:

```func IntsAreSorted(a []string) bool
```

Go program Example:

```package main

import (
"fmt"
"sort"
)

func main() {
productIds := []int{29, 2, 35, 425, 28, 12}    // unsorted list in Golang
fmt.Println(sort.IntsAreSorted(productIds))   // false

productIds = []int{4, 8, 19, 425, 852, 1222}   // sorted list in Golang
fmt.Println(sort.IntsAreSorted(productIds))   // true
}
```

When simple We execute the Go program, We can get the display following output:

Also Read This π   StringsAreSorted function in GO language program

```C:\golang>go run sort.go
false
true

C:\golang>
```