Skip to content

Commit

Permalink
starting work on version 4 (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
trobro authored Jul 23, 2022
1 parent 84d00df commit d950da4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 25 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
tags:
- 'v[0-9]+.[0-9]+**'

env:
GO111MODULE: auto

jobs:

build_hjson-cli_releases:
Expand All @@ -24,10 +21,6 @@ jobs:

- name: Build the ${{ runner.os }} hjson-cli binary
run: |
mkdir -p ~/go/src/github.com/hjson
cd ..
cp -r hjson-go ~/go/src/github.com/hjson/
cd hjson-go
mkdir binaries
cd hjson-cli
go build
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: test
on: [push, pull_request]
env:
GO111MODULE: auto
jobs:
test:
runs-on: ${{ matrix.os }}
Expand All @@ -11,12 +9,8 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- run: |
mkdir -p ~/go/src/github.com/hjson
cd ..
cp -r hjson-go ~/go/src/github.com/hjson/
- run: go version
- run: go test -v
- run: |
cd ~/go/src/github.com/hjson/hjson-go/hjson-cli
cd hjson-cli
go install -i
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Go Pkg](https://img.shields.io/github/release/hjson/hjson-go.svg?style=flat-square&label=go-pkg)](https://github.com/hjson/hjson-go/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/hjson/hjson-go?style=flat-square)](https://goreportcard.com/report/github.com/hjson/hjson-go)
[![coverage](https://img.shields.io/badge/coverage-ok-brightgreen.svg?style=flat-square)](http://gocover.io/github.com/hjson/hjson-go/)
[![godoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/hjson/hjson-go)
[![godoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/hjson/hjson-go/v4)

![Hjson Intro](https://hjson.github.io/hjson1.gif)

Expand Down Expand Up @@ -33,14 +33,13 @@ The Go implementation of Hjson is based on [hjson-js](https://github.com/hjson/h

Make sure you have a working Go environment. See the [install instructions](http://golang.org/doc/install.html).

1. Get the sources
```bash
$ go get -u github.com/hjson/hjson-go
- In order to use Hjson from your own Go source code, just add an import line like the one here below. Before building your project, run `go mod tidy` in order to download the Hjson source files. The suffix `/v4` is required in the import path, unless you specifically want to use an older major version.
```go
import "github.com/hjson/hjson-go/v4"
```
2. Build the **hjson-cli** commandline tool (optional)
- If you instead want to use the **hjson-cli** command line tool, run the command here below in your terminal. The executable will be installed into your `go/bin` folder, make sure that folder is included in your `PATH` environment variable.
```bash
$ cd $(go env GOPATH)/src/github.com/hjson/hjson-go/hjson-cli && go install
$ hjson-cli --version
$ go install github.com/hjson/hjson-go/hjson-cli@latest
```
# Usage as command line tool
```
Expand Down Expand Up @@ -76,7 +75,7 @@ Sample:
package main

import (
"github.com/hjson/hjson-go"
"github.com/hjson/hjson-go/v4"
"fmt"
)

Expand Down Expand Up @@ -133,7 +132,7 @@ If you prefer, you can also unmarshal to Go objects by converting to JSON:
package main

import (
"github.com/hjson/hjson-go"
"github.com/hjson/hjson-go/v4"
"encoding/json"
"fmt"
)
Expand Down Expand Up @@ -174,7 +173,7 @@ func main() {

# API

[![godoc](https://godoc.org/github.com/hjson/hjson-go?status.svg)](http://godoc.org/github.com/hjson/hjson-go)
[![godoc](https://godoc.org/github.com/hjson/hjson-go/v4?status.svg)](http://godoc.org/github.com/hjson/hjson-go/v4)

# History

Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/hjson/hjson-go/v4

go 1.11
2 changes: 1 addition & 1 deletion hjson-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/hjson/hjson-go"
"github.com/hjson/hjson-go/v4"
"io/ioutil"
"os"
)
Expand Down

0 comments on commit d950da4

Please sign in to comment.