Categorygithub.com/wmentor/endian
repositorypackage
1.0.0
Repository: https://github.com/wmentor/endian.git
Documentation: pkg.go.dev

# README

endian

test https://goreportcard.com/report/github.com/wmentor/endian https://pkg.go.dev/github.com/wmentor/endian License: MIT

Detect byte order library (BigEndian or LittleEndian)

Get bytes order

package main

import (
	"fmt"

	"github.com/wmentor/endian"
)

func main() {
    order := endian.GetOrder()

    if order == endian.BigEndian {
        fmt.Println("Big Endian")
    } else {
        fmt.Println("Little Endian")
    }
}

Insted of endian.BigEndian you can use endian.LittleEndian constant.