status-go/vendor/gopkg.in/sourcemap.v1
Igor Mandrigin fb3d2ff6fe
Introduce the dependency vendoring tool: `dep`. (#551)
* Introduce `dep`, the dependency vendoring tool.

Use commits from `go-ethereum@release/1.7` for most of the dependencies.

* Update dependencies.
2018-01-25 14:08:43 +01:00
..
base64vlq Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00
.travis.yml Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00
LICENSE Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00
Makefile Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00
README.md Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00
consumer.go Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00
sourcemap.go Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00

README.md

Source Maps consumer for Golang Build Status

Installation

Install:

go get gopkg.in/sourcemap.v1

Quickstart

func ExampleParse() {
	mapURL := "http://code.jquery.com/jquery-2.0.3.min.map"
	resp, err := http.Get(mapURL)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	b, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}

	smap, err := sourcemap.Parse(mapURL, b)
	if err != nil {
		panic(err)
	}

	line, column := 5, 6789
	file, fn, line, col, ok := smap.Source(line, column)
	fmt.Println(file, fn, line, col, ok)
	// Output: http://code.jquery.com/jquery-2.0.3.js apply 4360 27 true
}