quorum/vendor/gopkg.in/sourcemap.v1
Qvintvs 4b44bea1d7 Merge attempt 2018-05-31 14:16:44 +08:00
..
base64vlq Geth 1.7.2 rebase and addition of Istanbul BFT (#207) 2017-10-31 18:24:11 -04:00
LICENSE Godeps, vendor: convert dependency management to trash (#3198) 2016-10-28 19:05:01 +02:00
Makefile Geth 1.7.2 rebase and addition of Istanbul BFT (#207) 2017-10-31 18:24:11 -04:00
README.md Godeps, vendor: convert dependency management to trash (#3198) 2016-10-28 19:05:01 +02:00
consumer.go Geth 1.7.2 rebase and addition of Istanbul BFT (#207) 2017-10-31 18:24:11 -04:00
sourcemap.go Geth 1.7.2 rebase and addition of Istanbul BFT (#207) 2017-10-31 18:24:11 -04: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
}