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

github.com/philandstuff/dhall-golang/v6

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/philandstuff/dhall-golang/v6

  • v6.0.2
  • Source
  • Go
  • Socket score

Version published
Created
Source

dhall-golang

GoDoc

Go bindings for the dhall configuration language.

Quick start

Here's a minimal example of how you might use dhall-golang to load a Dhall file into your own struct:

package main

import (
	"fmt"

	"github.com/philandstuff/dhall-golang/v6"
)

// Config can be a fairly arbitrary Go datatype.  You would put your
// application configuration in this struct.
type Config struct {
	Port int
	Name string
}

func main() {
	var config Config
	err = dhall.UnmarshalFile("/path/to/config.dhall", &config)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Loaded config: %#v\n", config)
}

Documentation

You can find more documentation in the dhall-golang godoc.

Development

This is a fairly standard Go project. It uses go modules, so no vendoring of dependencies is required.

Running the tests

git submodule update --init --recursive

go test ./...

go test -short ./... # skips long-running tests

Making changes to the PEG grammar

Dhall-golang uses pigeon to generate the parser source file parser/internal/dhall.go from the PEG grammar at parser/internal/dhall.peg. If you change the PEG grammar, you need to first install the pigeon binary if you don't already have it:

# either outside a module directory, or with GO111MODULE=off
go get github.com/mna/pigeon

Then, to regenerate the parser:

go generate ./parser

Support

Issues and pull requests are welcome on this repository. If you have a question, you can ask it on the Dhall discourse.

FAQs

Package last updated on 09 Oct 2021

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