Skip to content

Commit

Permalink
Update package naming
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkauzh committed Oct 3, 2023
1 parent faeaf4c commit 9412e97
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 25 deletions.
4 changes: 2 additions & 2 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package main

import (
// Import the webzen package
"webzen/src/webzen"
"github.com/dimkauzh/webzen/src/webzen"

// Import the webzen draw package
"webzen/src/webzen/draw"
"github.com/dimkauzh/webzen/src/webzen/draw"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module webzen
module github.com/dimkauzh/webzen

go 1.18
24 changes: 12 additions & 12 deletions src/backend/console/log.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package console

import (
"fmt"
"syscall/js"
"fmt"
"syscall/js"
)

func Log(args ...interface{}) {
logArgs := make([]interface{}, len(args))
for i, arg := range args {
// Convert arrays to strings before logging
if arr, ok := arg.([]interface{}); ok {
logArgs[i] = fmt.Sprintf("%v", arr)
} else {
logArgs[i] = arg
}
}
logArgs := make([]interface{}, len(args))
for i, arg := range args {
// Convert arrays to strings before logging
if arr, ok := arg.([]interface{}); ok {
logArgs[i] = fmt.Sprintf("%v", arr)
} else {
logArgs[i] = arg
}
}

js.Global().Get("console").Call("log", logArgs...)
js.Global().Get("console").Call("log", logArgs...)
}
3 changes: 2 additions & 1 deletion src/webzen/draw/rect.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package draw

import (
"strconv"
"webzen/src/backend/document"

"github.com/dimkauzh/webzen/src/backend/document"
)

func DrawRect(width, height, x, y float64, color [4]int) {
Expand Down
3 changes: 2 additions & 1 deletion src/webzen/draw/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package draw

import (
"strconv"
"webzen/src/backend/document"

"github.com/dimkauzh/webzen/src/backend/document"
)

func DrawText(text string, size, x, y int) {
Expand Down
5 changes: 3 additions & 2 deletions src/webzen/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package image

import (
"syscall/js"
"webzen/src/backend/document"
"webzen/src/backend/global"

"github.com/dimkauzh/webzen/src/backend/document"
"github.com/dimkauzh/webzen/src/backend/global"
)

func DrawImage(imagePath string, width, height, x, y float64) {
Expand Down
5 changes: 3 additions & 2 deletions src/webzen/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package webzen

import (
"syscall/js"
"webzen/src/backend/document"
"webzen/src/backend/window"

"github.com/dimkauzh/webzen/src/backend/document"
"github.com/dimkauzh/webzen/src/backend/window"
)

func Init() {
Expand Down
4 changes: 2 additions & 2 deletions tests/backend/backend.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"webzen/src/backend/console"
"webzen/src/backend/document"
"github.com/dimkauzh/webzen/src/backend/console"
"github.com/dimkauzh/webzen/src/backend/document"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions tests/test1/test1.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"webzen/src/webzen"
"webzen/src/webzen/draw"
"github.com/dimkauzh/webzen/src/webzen"
"github.com/dimkauzh/webzen/src/webzen/draw"
)

func main() {
Expand Down

0 comments on commit 9412e97

Please sign in to comment.