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

github.com/thediveo/osrelease

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/thediveo/osrelease

  • v1.0.2
  • Source
  • Go
  • Socket score

Version published
Created
Source

A Pedantic os-release Parser

License build and test Go Report Card Coverage

osrelease is a Go module implementing a slightly pedantic parser for the os-release file format, as specified in os-release(5). This implementation actually parses quoted assignment values for escape sequences in correct sequence, instead of simply doing blind search-and-replaces (which can result in unexpected results).

Oh, and this module has tests.

There's a reason why we call it the "pedantic" parser after all.

Usage

Simply get the OS identification variables using osrelease.New(). That's all.

package main

import "github.com/thediveo/osrelease"

func main() {
    vars := osrelease.New()
    for name, value := range vars {
        println(name, "=", value)
    }
}

Contributing

Please see CONTRIBUTING.md.

osrelease is Copyright 2021-23 Harald Albrecht, and licensed under the Apache License, Version 2.0.

FAQs

Package last updated on 27 Oct 2023

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