Skip to content

playground: Fix build error. #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions playground/playground.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"go/parser"
"go/scanner"
"go/token"
"go/types"
"strings"
"time"

Expand Down Expand Up @@ -62,13 +63,16 @@ func main() {

packages := make(map[string]*compiler.Archive)
var pkgsToLoad map[string]struct{}
importContext := compiler.NewImportContext(func(path string) (*compiler.Archive, error) {
if pkg, found := packages[path]; found {
return pkg, nil
}
pkgsToLoad[path] = struct{}{}
return &compiler.Archive{}, nil
})
importContext := &compiler.ImportContext{
Packages: map[string]*types.Package{"unsafe": types.Unsafe},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unsafe entry should be unnecessary since my latest commit gopherjs/gopherjs@f8510c9

Import: func(path string) (*compiler.Archive, error) {
if pkg, found := packages[path]; found {
return pkg, nil
}
pkgsToLoad[path] = struct{}{}
return &compiler.Archive{}, nil
},
}
fileSet := token.NewFileSet()
pkgsReceived := 0

Expand Down