Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/mithrandie/go-file

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/mithrandie/go-file

  • v1.1.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

go-file

Package file is a Go library to open files with file locking depending on the system.

Build Status GoDoc License: MIT

Install

go get github.com/mithrandie/go-file

Supported Systems

Currently file locking on the following systems are supported.

darwin dragonfly freebsd linux netbsd openbsd solaris

Advisory Lock

windows

Mandatory Lock

android nacl plan9 zos

Not Supported

Example

package main

import (
	"bufio"
	"fmt"
	 
	"github.com/mithrandie/go-file"
)

func main() {
	fp, err := file.OpenToRead("/path/to/file")
	if err != nil {
		panic(err)
	}
	defer file.Close(fp)

	scanner := bufio.NewScanner(fp)
	for scanner.Scan() {
		fmt.Println(scanner.Text())
	}
}

FAQs

Package last updated on 25 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc