status-go/vendor/gopkg.in/sourcemap.v1
Victor Farazdagi 5fb4aef1cc Initial refactoring + vendor update (after rebase) 2016-09-15 06:12:25 +03:00
..
base64vlq Initial refactoring + vendor update (after rebase) 2016-09-15 06:12:25 +03:00
.travis.yml Initial refactoring + vendor update (after rebase) 2016-09-15 06:12:25 +03:00
Makefile Initial refactoring + vendor update (after rebase) 2016-09-15 06:12:25 +03:00
README.md Initial refactoring + vendor update (after rebase) 2016-09-15 06:12:25 +03:00
consumer.go Initial refactoring + vendor update (after rebase) 2016-09-15 06:12:25 +03:00
consumer_test.go Initial refactoring + vendor update (after rebase) 2016-09-15 06:12:25 +03:00
example_test.go Initial refactoring + vendor update (after rebase) 2016-09-15 06:12:25 +03: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
}