Skip to content

Commit

Permalink
Migrate to go modules
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdevey committed Jun 6, 2021
1 parent 4946948 commit 2fafb19
Show file tree
Hide file tree
Showing 20 changed files with 66 additions and 44 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
.idea/Lux.iml
.idea/vcs.xml
.idea/workspace.xml

github.com
.idea/codeStyles/codeStyleConfig.xml
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/general/Outputs.go → api/general/Outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package general

import (
"pkg/color"
"github.com/fatih/color"
)

// PrintHeading prints text in a unified heading
Expand Down
28 changes: 14 additions & 14 deletions cmd/Lux/Lux.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package main

import (
"commands/brightness"
"commands/color"
"commands/devices"
"commands/help"
"commands/query"
"commands/turn"
"internal/general"
"github.com/bandev/lux/api/general"
"github.com/bandev/lux/commands/brightness"
"github.com/bandev/lux/commands/color"
"github.com/bandev/lux/commands/devices"
"github.com/bandev/lux/commands/help"
"github.com/bandev/lux/commands/query"
"github.com/bandev/lux/commands/turn"
colpkg "github.com/fatih/color"
"os"
colpkg "pkg/color"
)

// main is the command that is first
Expand All @@ -44,12 +44,12 @@ func main() {
// If an arg is present check what was
// requested
switch os.Args[1] {
case "devices": devices.Entry(os.Args); break
case "query": query.Entry(os.Args); break
case "turn": turn.Entry(os.Args); break
case "brightness": brightness.Entry(os.Args); break
case "color": color.Entry(os.Args); break
case "help": help.Entry(); break
case "devices": devices.Entry(os.Args)
case "query": query.Entry(os.Args)
case "turn": turn.Entry(os.Args)
case "brightness": brightness.Entry(os.Args)
case "color": color.Entry(os.Args)
case "help": help.Entry()
default: general.PrintHeading("Unknown command " + os.Args[1], colpkg.FgRed)
}
}
Expand Down
6 changes: 3 additions & 3 deletions commands/brightness/Entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package brightness

import (
"commands/devices"
"internal/general"
"github.com/bandev/lux/api/general"
"github.com/bandev/lux/commands/devices"
"github.com/fatih/color"
"os"
"pkg/color"
"strconv"
)

Expand Down
4 changes: 2 additions & 2 deletions commands/brightness/Structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package brightness

import (
"commands/devices"
"encoding/json"
"internal/general"
"github.com/bandev/lux/api/general"
"github.com/bandev/lux/commands/devices"
)

// Control struct manages the control
Expand Down
6 changes: 3 additions & 3 deletions commands/color/Entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package color

import (
"commands/devices"
"internal/general"
"github.com/bandev/lux/api/general"
"github.com/bandev/lux/commands/devices"
"github.com/fatih/color"
"os"
"pkg/color"
"strconv"
"strings"
)
Expand Down
4 changes: 2 additions & 2 deletions commands/color/Structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package color

import (
"commands/devices"
"encoding/json"
"internal/general"
"github.com/bandev/lux/api/general"
"github.com/bandev/lux/commands/devices"
)

// Control struct manages the control
Expand Down
4 changes: 2 additions & 2 deletions commands/devices/Entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package devices

import (
"internal/general"
"github.com/bandev/lux/api/general"
"github.com/fatih/color"
"os"
"pkg/color"
)

// Entry function is the entry point for
Expand Down
4 changes: 2 additions & 2 deletions commands/devices/Structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ package devices

import (
"encoding/json"
"internal/general"
"pkg/color"
"github.com/bandev/lux/api/general"
"github.com/fatih/color"
"strconv"
"strings"
)
Expand Down
4 changes: 2 additions & 2 deletions commands/help/Entry.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package help

import (
"internal/general"
"pkg/color"
"github.com/bandev/lux/api/general"
"github.com/fatih/color"
)

// Entry function is the entry point for
Expand Down
4 changes: 2 additions & 2 deletions commands/help/Structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ package help

import (
"encoding/json"
"internal/general"
"pkg/color"
"github.com/bandev/lux/api/general"
"github.com/fatih/color"
"strings"
)

Expand Down
6 changes: 3 additions & 3 deletions commands/query/Entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package query

import (
"commands/devices"
"internal/general"
"github.com/bandev/lux/api/general"
"github.com/bandev/lux/commands/devices"
"github.com/fatih/color"
"os"
"pkg/color"
"strconv"
)

Expand Down
6 changes: 3 additions & 3 deletions commands/query/Structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package query

import (
"commands/devices"
"internal/general"
"pkg/jsonparser"
"github.com/bandev/lux/api/general"
"github.com/bandev/lux/commands/devices"
"github.com/buger/jsonparser"
)

// Query is the struct for storing the
Expand Down
6 changes: 3 additions & 3 deletions commands/turn/Entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package turn

import (
"commands/devices"
"internal/general"
"github.com/bandev/lux/api/general"
"github.com/bandev/lux/commands/devices"
"github.com/fatih/color"
"os"
"pkg/color"
"strconv"
"strings"
)
Expand Down
4 changes: 2 additions & 2 deletions commands/turn/Structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package turn

import (
"commands/devices"
"encoding/json"
"internal/general"
"github.com/bandev/lux/api/general"
"github.com/bandev/lux/commands/devices"
)

// Control struct manages the control
Expand Down
8 changes: 8 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/bandev/lux

go 1.16

require (
github.com/buger/jsonparser v1.1.1
github.com/fatih/color v1.12.0
)
11 changes: 11 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc=
github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

0 comments on commit 2fafb19

Please sign in to comment.