Skip to content

bongole/go-jq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

go-jq

Go bindings for jq inspired by ruby-jq.

see http://stedolan.github.io/jq/.

see https://bitbucket.org/winebarrel/ruby-jq.

Installation

First, please install libjq from HEAD of git repository.

git clone https://github.com/stedolan/jq.git
cd jq
autoreconf -i
./configure --enable-shared
make
sudo make install
sudo ldconfig

Usage

package main

import (
   "github.com/bongole/go-jq"
   "fmt"
)

func main(){
   src := "{ \"foo\": 1 }"

   jq := jq.New(src)

   err := jq.Search(".foo", func(d interface{}){
      i := d.(float64)
      fmt.Printf("%f", i)
   })

   if err != nil {
      fmt.Printf("%s", err)
   }
}

License

  • MIT

About

Go bindings for jq inspired by ruby-jq.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages