go: rename module from github.com/facebook/ent => entgo.io/ent (#1226)

This commit is contained in:
Ariel Mashraki
2021-02-02 23:03:04 +02:00
committed by GitHub
parent 7a2173f20d
commit dd4792f5b3
1087 changed files with 3956 additions and 3956 deletions

View File

@@ -10,8 +10,8 @@ import (
"log"
"path/filepath"
"github.com/facebook/ent/cmd/internal/base"
"github.com/facebook/ent/entc/gen"
"entgo.io/ent/cmd/internal/base"
"entgo.io/ent/entc/gen"
"github.com/spf13/cobra"
)
@@ -30,11 +30,11 @@ func main() {
func migrate(c *gen.Config) {
var (
target = filepath.Join(c.Target, "generate.go")
oldCmd = []byte("github.com/facebook/ent/cmd/entc")
oldCmd = []byte("entgo.io/ent/cmd/entc")
)
buf, err := ioutil.ReadFile(target)
if err != nil || !bytes.Contains(buf, oldCmd) {
return
}
_ = ioutil.WriteFile(target, bytes.ReplaceAll(buf, oldCmd, []byte("github.com/facebook/ent/cmd/ent")), 0644)
_ = ioutil.WriteFile(target, bytes.ReplaceAll(buf, oldCmd, []byte("entgo.io/ent/cmd/ent")), 0644)
}

View File

@@ -15,7 +15,7 @@ import (
func TestCmd(t *testing.T) {
defer os.RemoveAll("ent")
cmd := exec.Command("go", "run", "github.com/facebook/ent/cmd/entc", "init", "User")
cmd := exec.Command("go", "run", "entgo.io/ent/cmd/entc", "init", "User")
stderr := bytes.NewBuffer(nil)
cmd.Stderr = stderr
require.NoError(t, cmd.Run(), stderr.String())
@@ -25,7 +25,7 @@ func TestCmd(t *testing.T) {
_, err = os.Stat("ent/schema/user.go")
require.NoError(t, err)
cmd = exec.Command("go", "run", "github.com/facebook/ent/cmd/entc", "generate", "./ent/schema")
cmd = exec.Command("go", "run", "entgo.io/ent/cmd/entc", "generate", "./ent/schema")
stderr = bytes.NewBuffer(nil)
cmd.Stderr = stderr
require.NoError(t, cmd.Run(), stderr.String())