Skip to content

amitybell/memio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro

Package memio implements common types and functions used for in-memory I/O.

Install

go get github.com/amitybell/memio

Usage

    package main

    import (
        "github.com/amitybell/memio"
        "io"
        "fmt"
    )

    func main() {
        // since File is purely in-memory, as long as all inputs are valid (e.g. Seek offsets/whence),
        // all method calls will succeed.
        f := &memio.File{}
        f.WriteString("hello world")
        // reset back to the begining of the file to begin reading
        f.Seek(0, 0)
        s, _ := io.ReadAll(f)
        fmt.Printf("%s\n", s)
    }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages