diff --git a/Makefile b/Makefile index 8a9718b..dff5ac3 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ all: $(BINS) clean: rm -f -v $(BINS) -bin/machine: cmd/machine/*.go cmd/machine/cmd/*.go pkg/*/*.go - go build -o $@ cmd/machine/*.go +bin/machine: cmd/machine/cmd/*.go pkg/*/*.go + go build -o $@ cmd/machine/cmd/*.go -bin/machined: cmd/machined/*.go cmd/machined/cmd/*.go pkg/*/*.go - go build -o $@ cmd/machined/*.go +bin/machined: cmd/machined/cmd/*.go pkg/*/*.go + go build -o $@ cmd/machined/cmd/*.go diff --git a/cmd/machine/cmd/console.go b/cmd/machine/cmd/console.go index 951f5c3..ed5c2f1 100644 --- a/cmd/machine/cmd/console.go +++ b/cmd/machine/cmd/console.go @@ -12,16 +12,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( "encoding/json" "fmt" - "machine/pkg/api" "os" "os/exec" log "github.com/sirupsen/logrus" + "github.com/project-machine/machine/pkg/api" "github.com/spf13/cobra" ) diff --git a/cmd/machine/cmd/delete.go b/cmd/machine/cmd/delete.go index c823680..67f3e96 100644 --- a/cmd/machine/cmd/delete.go +++ b/cmd/machine/cmd/delete.go @@ -12,13 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( "fmt" - "machine/pkg/api" "github.com/spf13/cobra" + "github.com/project-machine/machine/pkg/api" ) // deleteCmd represents the list command diff --git a/cmd/machine/cmd/edit.go b/cmd/machine/cmd/edit.go index 99f9cd9..d37015b 100644 --- a/cmd/machine/cmd/edit.go +++ b/cmd/machine/cmd/edit.go @@ -12,15 +12,15 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( "fmt" - "machine/pkg/api" "os" "github.com/lxc/lxd/shared" "github.com/lxc/lxd/shared/termios" + "github.com/project-machine/machine/pkg/api" "github.com/spf13/cobra" "golang.org/x/sys/unix" "gopkg.in/yaml.v2" diff --git a/cmd/machine/cmd/gui.go b/cmd/machine/cmd/gui.go index 5946c06..750a26e 100644 --- a/cmd/machine/cmd/gui.go +++ b/cmd/machine/cmd/gui.go @@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( - "machine/pkg/api" - "github.com/spf13/cobra" + + "github.com/project-machine/machine/pkg/api" ) // guiCmd represents the gui command diff --git a/cmd/machine/cmd/info.go b/cmd/machine/cmd/info.go index 4e73c4b..52effe2 100644 --- a/cmd/machine/cmd/info.go +++ b/cmd/machine/cmd/info.go @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( "fmt" diff --git a/cmd/machine/cmd/init.go b/cmd/machine/cmd/init.go index e444156..9d3ab39 100644 --- a/cmd/machine/cmd/init.go +++ b/cmd/machine/cmd/init.go @@ -11,12 +11,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( "fmt" "io/ioutil" - "machine/pkg/api" "os" "path/filepath" "sort" @@ -26,6 +25,7 @@ import ( "github.com/lxc/lxd/shared" "github.com/lxc/lxd/shared/termios" homedir "github.com/mitchellh/go-homedir" + "github.com/project-machine/machine/pkg/api" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" "golang.org/x/sys/unix" diff --git a/cmd/machine/cmd/list.go b/cmd/machine/cmd/list.go index 03b7d6b..e1f29e2 100644 --- a/cmd/machine/cmd/list.go +++ b/cmd/machine/cmd/list.go @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( "fmt" diff --git a/cmd/machine/main.go b/cmd/machine/cmd/main.go similarity index 91% rename from cmd/machine/main.go rename to cmd/machine/cmd/main.go index 6e474be..b0b24f5 100644 --- a/cmd/machine/main.go +++ b/cmd/machine/cmd/main.go @@ -14,8 +14,6 @@ limitations under the License. */ package main -import "machine/cmd/machine/cmd" - func main() { - cmd.Execute() + Execute() } diff --git a/cmd/machine/cmd/root.go b/cmd/machine/cmd/root.go index adf46f4..3a2bb61 100644 --- a/cmd/machine/cmd/root.go +++ b/cmd/machine/cmd/root.go @@ -12,13 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( "context" "encoding/json" "fmt" - "machine/pkg/api" "math/rand" "net" "net/http" @@ -27,6 +26,7 @@ import ( "time" "github.com/go-resty/resty/v2" + "github.com/project-machine/machine/pkg/api" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/cmd/machine/cmd/run.go b/cmd/machine/cmd/run.go index b478b92..85078c4 100644 --- a/cmd/machine/cmd/run.go +++ b/cmd/machine/cmd/run.go @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( "fmt" diff --git a/cmd/machine/cmd/start.go b/cmd/machine/cmd/start.go index e2ab079..708be15 100644 --- a/cmd/machine/cmd/start.go +++ b/cmd/machine/cmd/start.go @@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( "fmt" - "machine/pkg/api" + "github.com/project-machine/machine/pkg/api" "github.com/spf13/cobra" ) diff --git a/cmd/machine/cmd/stop.go b/cmd/machine/cmd/stop.go index 9fc6b75..56e840a 100644 --- a/cmd/machine/cmd/stop.go +++ b/cmd/machine/cmd/stop.go @@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package cmd +package main import ( "fmt" - "machine/pkg/api" + "github.com/project-machine/machine/pkg/api" "github.com/spf13/cobra" ) diff --git a/cmd/machined/cmd/install.go b/cmd/machined/cmd/install.go index 22443d3..edd69e5 100644 --- a/cmd/machined/cmd/install.go +++ b/cmd/machined/cmd/install.go @@ -1,12 +1,12 @@ -package cmd +package main import ( "fmt" - "machine/pkg/api" "os" "os/exec" "path/filepath" + "github.com/project-machine/machine/pkg/api" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) diff --git a/cmd/machined/main.go b/cmd/machined/cmd/main.go similarity index 91% rename from cmd/machined/main.go rename to cmd/machined/cmd/main.go index 6ee747e..b0b24f5 100644 --- a/cmd/machined/main.go +++ b/cmd/machined/cmd/main.go @@ -14,8 +14,6 @@ limitations under the License. */ package main -import "machine/cmd/machined/cmd" - func main() { - cmd.Execute() + Execute() } diff --git a/cmd/machined/cmd/remove.go b/cmd/machined/cmd/remove.go index 3d28545..b7e1cad 100644 --- a/cmd/machined/cmd/remove.go +++ b/cmd/machined/cmd/remove.go @@ -1,12 +1,12 @@ -package cmd +package main import ( "fmt" - "machine/pkg/api" "os" "os/exec" "path/filepath" + "github.com/project-machine/machine/pkg/api" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) diff --git a/cmd/machined/cmd/root.go b/cmd/machined/cmd/root.go index 447271a..9ac307b 100644 --- a/cmd/machined/cmd/root.go +++ b/cmd/machined/cmd/root.go @@ -1,10 +1,9 @@ -package cmd +package main import ( "context" "fmt" "io/ioutil" - "machine/pkg/api" "math/rand" "net/http" "os" @@ -14,6 +13,7 @@ import ( "text/template" "time" + "github.com/project-machine/machine/pkg/api" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/go.mod b/go.mod index de69d63..3658899 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module machine +module github.com/project-machine/machine go 1.18