| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This package is not in the latest version of its module.
Go to latest Published: Mar 13, 2024 License: BSD-2-ClauseThe Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Modules with tagged versions give importers more predictable builds.
When a project reaches major version v1 it is considered stable.
This section is empty.
This section is empty.
This section is empty.
type Consumer struct {
// contains filtered or unexported fields
}
package main
import (
"fmt"
"io/ioutil"
"net/http"
"github.com/go-sourcemap/sourcemap"
)
func main() {
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
File returns an optional name of the generated code that this source map is associated with.
func (c *Consumer) Source( genLine, genColumn int, ) (source, name string, line, column int, ok bool)
Source returns the original source, name, line, and column information for the generated source's line and column positions.
SourceContent returns the original source content for the source.
| Back | FazBrowse Home | New Git URL |