internal
Reduce mapping value sizebench_test.go
Remove gopkg.inconsumer_test.go
Added a basic testconsumer.go
feat: Add json/v2 support for faster sourcemap parsingexample_test.go
Remove gopkg.injson_decoder_v2.go
feat: Add json/v2 support for faster sourcemap parsingjson_decoder.go
feat: Add json/v2 support for faster sourcemap parsingLICENSE
Add license. Fixes #1.Makefile
Update Travis config.mappings_test.go
Better detection that a value should be pushedmappings.go
Better detection that a value should be pushedREADME.md
chore: cleanupSource maps consumer for Golang
This package is brought to you by :star: uptrace/uptrace. Uptrace is an open-source APM tool that supports distributed tracing, metrics, and logs. You can use it to monitor applications and set up automatic alerts to receive notifications via email, Slack, Telegram, and others.
Installation
Install:
go get -u github.com/go-sourcemap/sourcemapQuickstart
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
}