frictionlessdata / datapackage-go

A Go library for working with Data Package.
MIT License
21 stars 5 forks source link

Problems loading packages from the web #11

Closed danielfireman closed 6 years ago

danielfireman commented 6 years ago

The following program:

package main

import (
    "fmt"

    "github.com/frictionlessdata/datapackage-go/datapackage"
)

func main() {
    d, err := datapackage.Load("https://raw.githubusercontent.com/frictionlessdata/example-data-packages/master/periodic-table/datapackage.json")
    if err != nil {
        panic(err)
    }
    fmt.Println(d.ResourceNames())
    r := d.GetResource("data")
    contents, err := r.ReadAll()
    if err != nil {
        panic(err)
    }
    fmt.Println(contents)
}

Panics with the following error message:

panic: Get https:///raw.githubusercontent.com/frictionlessdata/example-data-packages/master/periodic-table/data.csv: http: no Host in request URL

danielfireman commented 6 years ago

After the last commit on this issue and fixing #12 we've gone down to:

panic: Get https:///raw.githubusercontent.com/frictionlessdata/example-data-packages/master/periodic-table/data.csv: http: no Host in request URL

Note there are three slashes in the resource path.