mark2web/vendor/gopkg.in/sourcemap.v1
Sebastian Frank a781485c0a
Some checks failed
continuous-integration/drone/push Build is failing
no git submodules
2022-02-28 10:28:34 +01:00
..
base64vlq no git submodules 2022-02-28 10:28:34 +01:00
.travis.yml no git submodules 2022-02-28 10:28:34 +01:00
consumer.go no git submodules 2022-02-28 10:28:34 +01:00
LICENSE no git submodules 2022-02-28 10:28:34 +01:00
Makefile no git submodules 2022-02-28 10:28:34 +01:00
README.md no git submodules 2022-02-28 10:28:34 +01:00
sourcemap.go no git submodules 2022-02-28 10:28:34 +01:00

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
}