byteorder

package module
v0.0.0-...-49d969b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2018 License: MIT Imports: 2 Imported by: 2

README

byteorder

Build Status GoDoc

byteorder is a Golang package which detects byte order of runtime system.

Example

package main

import (
        "encoding/binary"
        "log"

        "github.com/northbright/byteorder"
)

func main() {
        order := byteorder.Get()

        log.Printf("Byte Order: ")
        if order == binary.LittleEndian {
                log.Printf("Little Endian")
        } else {
                log.Printf("Big Endian")
        }
}

Documentation

License

Documentation

Overview

Package byteorder detects byte order of runtime system.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() binary.ByteOrder

Get detects and returns the byte order of runtime system. Return type: binary.ByteOrder interface. Possible values: binary.LittleEndian and binary.BigEndian. See https://godoc.org/encoding/binary#pkg-variables for more information.

Example
package main

import (
	"encoding/binary"
	"log"

	"github.com/northbright/byteorder"
)

func main() {
	order := byteorder.Get()

	log.Printf("Byte Order: ")
	if order == binary.LittleEndian {
		log.Printf("Little Endian")
	} else {
		log.Printf("Big Endian")
	}

}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL