Skip to content

Commit

Permalink
replace module to allow external go install
Browse files Browse the repository at this point in the history
  • Loading branch information
switchupcb committed Oct 26, 2021
1 parent aa22dd6 commit c17b626
Show file tree
Hide file tree
Showing 57 changed files with 127 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ contact_links:
url: https://community.traefik.io/c/yaegi
about: If you have a question, or are looking for advice, please post on our discussions forum!
- name: Documentation
url: https://pkg.go.dev/github.com/traefik/yaegi
url: https://pkg.go.dev/github.com/switchupcb/yaegi
about: Please take a look to our documenation.
4 changes: 2 additions & 2 deletions .github/workflows/go-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ github.workspace }}/go/src/github.com/traefik/yaegi
working-directory: ${{ github.workspace }}/go/src/github.com/switchupcb/yaegi

strategy:
matrix:
Expand All @@ -39,7 +39,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
with:
path: go/src/github.com/traefik/yaegi
path: go/src/github.com/switchupcb/yaegi

# https://github.com/marketplace/actions/cache
- name: Cache Go modules
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
needs: linting
defaults:
run:
working-directory: ${{ github.workspace }}/go/src/github.com/traefik/yaegi
working-directory: ${{ github.workspace }}/go/src/github.com/switchupcb/yaegi
strategy:
matrix:
go-version: [ 1.16, 1.17 ]
Expand All @@ -86,7 +86,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v2
with:
path: go/src/github.com/traefik/yaegi
path: go/src/github.com/switchupcb/yaegi
fetch-depth: 0

# https://github.com/marketplace/actions/cache
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ brews:
name: traefiker
email: [email protected]
folder: Formula
homepage: https://github.com/traefik/yaegi
homepage: https://github.com/switchupcb/yaegi
description: |
Yaegi is Another Elegant Go Interpreter.
It powers executable Go scripts and plugins, in embedded interpreters
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Yaegi is an open source project, and your feedback and contributions
are needed and always welcome.

[Issues] and [Pull Requests] are opened at https://github.com/traefik/yaegi.
[Issues] and [Pull Requests] are opened at https://github.com/switchupcb/yaegi.

Non trivial changes should be discussed with the project maintainers by
opening a [Feature Request] clearly explaining rationale, background
Expand All @@ -17,8 +17,8 @@ We will also require you to sign the [Traefik Contributor License Agreement]
after you submit your first pull request to this project. The link to sign the
agreement will be presented to you in the web interface of the pull request.

[Issues]: https://github.com/traefik/yaegi/issues
[Pull Requests]: https://github.com/traefik/yaegi/issues
[Feature Request]: https://github.com/traefik/yaegi/issues/new?template=feature_request.md
[Issues]: https://github.com/switchupcb/yaegi/issues
[Pull Requests]: https://github.com/switchupcb/yaegi/issues
[Feature Request]: https://github.com/switchupcb/yaegi/issues/new?template=feature_request.md
[Draft Pull Request]: https://github.blog/2019-02-14-introducing-draft-pull-requests/
[Traefik Labs Contributor License Agreement]: https://cla-assistant.io/traefik/yaegi
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<img width="400" src="doc/images/yaegi.png" alt="Yaegi" title="Yaegi" />
</p>

[![release](https://img.shields.io/github/tag-date/traefik/yaegi.svg?label=alpha)](https://github.com/traefik/yaegi/releases)
[![Build Status](https://github.com/traefik/yaegi/actions/workflows/main.yml/badge.svg)](https://github.com/traefik/yaegi/actions/workflows/main.yml)
[![GoDoc](https://godoc.org/github.com/traefik/yaegi?status.svg)](https://pkg.go.dev/mod/github.com/traefik/yaegi)
[![release](https://img.shields.io/github/tag-date/traefik/yaegi.svg?label=alpha)](https://github.com/switchupcb/yaegi/releases)
[![Build Status](https://github.com/switchupcb/yaegi/actions/workflows/main.yml/badge.svg)](https://github.com/switchupcb/yaegi/actions/workflows/main.yml)
[![GoDoc](https://godoc.org/github.com/switchupcb/yaegi?status.svg)](https://pkg.go.dev/mod/github.com/switchupcb/yaegi)
[![Discourse status](https://img.shields.io/discourse/https/community.traefik.io/status?label=Community&style=social)](https://community.traefik.io/c/yaegi)

Yaegi is Another Elegant Go Interpreter.
Expand All @@ -26,13 +26,13 @@ It powers executable Go scripts and plugins, in embedded interpreters or interac
### Go package

```go
import "github.com/traefik/yaegi/interp"
import "github.com/switchupcb/yaegi/interp"
```

### Command-line executable

```bash
go get -u github.com/traefik/yaegi/cmd/yaegi
go get -u github.com/switchupcb/yaegi/cmd/yaegi
```

Note that you can use [rlwrap](https://github.com/hanslub42/rlwrap) (install with your favorite package manager),
Expand All @@ -54,8 +54,8 @@ Create an interpreter with `New()`, run Go code with `Eval()`:
package main

import (
"github.com/traefik/yaegi/interp"
"github.com/traefik/yaegi/stdlib"
"github.com/switchupcb/yaegi/interp"
"github.com/switchupcb/yaegi/stdlib"
)

func main() {
Expand Down Expand Up @@ -88,7 +88,7 @@ The following program is compiled ahead of time, except `bar()` which is interpr
```go
package main

import "github.com/traefik/yaegi/interp"
import "github.com/switchupcb/yaegi/interp"

const src = `package foo
func Bar(s string) string { return s + "-Foo" }`
Expand Down Expand Up @@ -147,7 +147,7 @@ $ yaegi
Or interpret Go packages, directories or files, including itself:

```console
$ yaegi -syscall -unsafe -unrestricted github.com/traefik/yaegi/cmd/yaegi
$ yaegi -syscall -unsafe -unrestricted github.com/switchupcb/yaegi/cmd/yaegi
>
```

Expand Down Expand Up @@ -192,7 +192,7 @@ Beside the known [bugs] which are supposed to be fixed in the short term, there
[Apache 2.0][License].

[specs]: https://golang.org/ref/spec
[docs]: https://pkg.go.dev/github.com/traefik/yaegi
[license]: https://github.com/traefik/yaegi/blob/master/LICENSE
[github]: https://github.com/traefik/yaegi
[bugs]: https://github.com/traefik/yaegi/issues?q=is%3Aissue+is%3Aopen+label%3Abug
[docs]: https://pkg.go.dev/github.com/switchupcb/yaegi
[license]: https://github.com/switchupcb/yaegi/blob/master/LICENSE
[github]: https://github.com/switchupcb/yaegi
[bugs]: https://github.com/switchupcb/yaegi/issues?q=is%3Aissue+is%3Aopen+label%3Abug
2 changes: 1 addition & 1 deletion _test/alias3.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/traefik/yaegi/_test/alias3"
import "github.com/switchupcb/yaegi/_test/alias3"

var globalT *T

Expand Down
2 changes: 1 addition & 1 deletion _test/b1/foo/foo.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package foo

import bar "github.com/traefik/yaegi/_test/b2/foo"
import bar "github.com/switchupcb/yaegi/_test/b2/foo"

var Desc = "in b1/foo"

Expand Down
2 changes: 1 addition & 1 deletion _test/c1/c1.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package c1

import "github.com/traefik/yaegi/_test/c2"
import "github.com/switchupcb/yaegi/_test/c2"

var C1 = c2.C2 + "x"
2 changes: 1 addition & 1 deletion _test/c2/c2.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package c2

import "github.com/traefik/yaegi/_test/c1"
import "github.com/switchupcb/yaegi/_test/c1"

var C2 = c1.C1 + "Y"
2 changes: 1 addition & 1 deletion _test/composite6.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/traefik/yaegi/_test/ct1"
"github.com/switchupcb/yaegi/_test/ct1"
)

type T struct {
Expand Down
2 changes: 1 addition & 1 deletion _test/d2/d2.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package d2

import "github.com/traefik/yaegi/_test/d1"
import "github.com/switchupcb/yaegi/_test/d1"

var (
X = d1.NewT("test")
Expand Down
2 changes: 1 addition & 1 deletion _test/d3.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/traefik/yaegi/_test/d2"
import "github.com/switchupcb/yaegi/_test/d2"

func main() {
f := d2.F
Expand Down
2 changes: 1 addition & 1 deletion _test/eval0.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"log"
"os"

"github.com/traefik/yaegi/interp"
"github.com/switchupcb/yaegi/interp"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _test/foo/bar.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package foo

import "github.com/traefik/yaegi/_test/foo/boo"
import "github.com/switchupcb/yaegi/_test/foo/boo"

var Bar = "BARR"
var Boo = boo.Boo
Expand Down
2 changes: 1 addition & 1 deletion _test/foo/bir.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package foo

import "github.com/traefik/yaegi/_test/foo/boo"
import "github.com/switchupcb/yaegi/_test/foo/boo"

var Bir = boo.Boo + "22"
2 changes: 1 addition & 1 deletion _test/import3.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/traefik/yaegi/_test/foo"
import "github.com/switchupcb/yaegi/_test/foo"

func main() { println(foo.Bar, foo.Boo) }

Expand Down
2 changes: 1 addition & 1 deletion _test/import4.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/traefik/yaegi/_test/p1"
import "github.com/switchupcb/yaegi/_test/p1"

func main() { println("num:", p1.Uint32()) }

Expand Down
2 changes: 1 addition & 1 deletion _test/import5.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import boo "github.com/traefik/yaegi/_test/foo"
import boo "github.com/switchupcb/yaegi/_test/foo"

func main() { println(boo.Bar, boo.Boo, boo.Bir) }

Expand Down
4 changes: 2 additions & 2 deletions _test/import6.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package main

import "github.com/traefik/yaegi/_test/c1"
import "github.com/switchupcb/yaegi/_test/c1"

func main() {
println(c1.C1)
}

// Error:
// import cycle not allowed
// imports github.com/traefik/yaegi/_test/c1
// imports github.com/switchupcb/yaegi/_test/c1
2 changes: 1 addition & 1 deletion _test/import7.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import bar "github.com/traefik/yaegi/_test/foo-bar"
import bar "github.com/switchupcb/yaegi/_test/foo-bar"

func main() {
println(bar.Name)
Expand Down
2 changes: 1 addition & 1 deletion _test/import8.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/traefik/yaegi/_test/b1/foo"
import "github.com/switchupcb/yaegi/_test/b1/foo"

func main() {
println(foo.Desc)
Expand Down
2 changes: 1 addition & 1 deletion _test/import9.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/traefik/yaegi/_test/baz-bat"
import "github.com/switchupcb/yaegi/_test/baz-bat"

func main() {
println(baz.Name)
Expand Down
4 changes: 2 additions & 2 deletions _test/inception.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package main
import (
"log"

"github.com/traefik/yaegi/interp"
"github.com/switchupcb/yaegi/interp"
)

func main() {
log.SetFlags(log.Lshortfile)
i := interp.New(interp.Options{})
i.Use(interp.Symbols)
if _, err := i.Eval(`import "github.com/traefik/yaegi/interp"`); err != nil {
if _, err := i.Eval(`import "github.com/switchupcb/yaegi/interp"`); err != nil {
log.Fatal(err)
}
if _, err := i.Eval(`i := interp.New(interp.Options{})`); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion _test/interp.gi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/traefik/yaegi/interp"
"github.com/switchupcb/yaegi/interp"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions _test/interp2.gi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package main

import (
"github.com/traefik/yaegi/interp"
"github.com/switchupcb/yaegi/interp"
)

func main() {
i := interp.New(interp.Opt{})
i.Use(interp.ExportValue, interp.ExportType)
i.Eval(`import "github.com/traefik/yaegi/interp"`)
i.Eval(`import "github.com/switchupcb/yaegi/interp"`)
i.Eval(`i := interp.New(interp.Opt{})`)
i.Eval(`i.Eval("println(42)")`)
}
Expand Down
2 changes: 1 addition & 1 deletion _test/method38.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/traefik/yaegi/_test/method38"
"github.com/switchupcb/yaegi/_test/method38"
)

func main() {
Expand Down
3 changes: 1 addition & 2 deletions _test/method39.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"sync"

"github.com/traefik/yaegi/_test/method38"
"github.com/switchupcb/yaegi/_test/method38"
)

func NewPool() Pool { return Pool{} }
Expand All @@ -23,7 +23,6 @@ var (
Get = _pool.Get
)


func main() {
fmt.Println(Get())
}
Expand Down
2 changes: 1 addition & 1 deletion _test/tag0.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package main

import _ "github.com/traefik/yaegi/_test/ct"
import _ "github.com/switchupcb/yaegi/_test/ct"

func main() {
println("bye")
Expand Down
2 changes: 1 addition & 1 deletion _test/var14.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/traefik/yaegi/_test/vars"
import "github.com/switchupcb/yaegi/_test/vars"

func main() {
println(vars.A)
Expand Down
2 changes: 1 addition & 1 deletion cmd/yaegi/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"path/filepath"
"strings"

"github.com/traefik/yaegi/extract"
"github.com/switchupcb/yaegi/extract"
)

func extractCmd(arg []string) error {
Expand Down
10 changes: 5 additions & 5 deletions cmd/yaegi/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"strconv"
"strings"

"github.com/traefik/yaegi/interp"
"github.com/traefik/yaegi/stdlib"
"github.com/traefik/yaegi/stdlib/syscall"
"github.com/traefik/yaegi/stdlib/unrestricted"
"github.com/traefik/yaegi/stdlib/unsafe"
"github.com/switchupcb/yaegi/interp"
"github.com/switchupcb/yaegi/stdlib"
"github.com/switchupcb/yaegi/stdlib/syscall"
"github.com/switchupcb/yaegi/stdlib/unrestricted"
"github.com/switchupcb/yaegi/stdlib/unsafe"
)

func run(arg []string) error {
Expand Down
Loading

0 comments on commit c17b626

Please sign in to comment.