5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-09 07:29:38 +08:00

Fix tests

This commit is contained in:
Lea Anthony 2023-09-08 12:04:21 +10:00
parent 965f939967
commit b925335bbb
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
18 changed files with 555 additions and 800 deletions

View File

@ -52,7 +52,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
WindowsFilename: "appicon.ico", WindowsFilename: "appicon.ico",
@ -94,7 +94,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
MacFilename: "appicon.icns", MacFilename: "appicon.icns",
@ -133,7 +133,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
Sizes: "16", Sizes: "16",
@ -181,7 +181,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
} }
@ -195,7 +195,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
WindowsFilename: "appicon.ico", WindowsFilename: "appicon.ico",
@ -211,7 +211,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
WindowsFilename: "appicon.ico", WindowsFilename: "appicon.ico",

View File

@ -1,39 +0,0 @@
package commands
import "testing"
func TestBuild(t *testing.T) {
type args struct {
options *RunTaskOptions
otherArgs []string
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: "should error if task name not provided",
args: args{
options: &RunTaskOptions{},
},
wantErr: true,
},
{
name: "should work if task name provided",
args: args{
options: &RunTaskOptions{
Name: "build",
},
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := RunTask(tt.args.options, tt.args.otherArgs); (err != nil) != tt.wantErr {
t.Errorf("Run() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

View File

@ -108,6 +108,9 @@ func GenerateBinding(structName string, method *BoundMethod) (string, []string)
result = strings.ReplaceAll(result, "{{methodName}}", method.Name) result = strings.ReplaceAll(result, "{{methodName}}", method.Name)
result = strings.ReplaceAll(result, "{{ID}}", fmt.Sprintf("%v", method.ID)) result = strings.ReplaceAll(result, "{{ID}}", fmt.Sprintf("%v", method.ID))
comments := strings.TrimSpace(method.DocComment) comments := strings.TrimSpace(method.DocComment)
if comments != "" {
comments = " " + comments
}
result = strings.ReplaceAll(result, "Comments", comments) result = strings.ReplaceAll(result, "Comments", comments)
var params string var params string
for _, input := range method.Inputs { for _, input := range method.Inputs {
@ -238,7 +241,7 @@ window.go = window.go || {};
for _, method := range methods { for _, method := range methods {
thisBinding, models := GenerateBinding(structName, method) thisBinding, models := GenerateBinding(structName, method)
allModels = append(allModels, models...) allModels = append(allModels, models...)
result[normalisedPackageNames[packageName]] += " " + thisBinding result[normalisedPackageNames[packageName]] += thisBinding
} }
result[normalisedPackageNames[packageName]] += " },\n" result[normalisedPackageNames[packageName]] += " },\n"
} }

View File

@ -110,6 +110,11 @@ func TestGenerateBindings(t *testing.T) {
return return
} }
// compare the binding // compare the binding
// convert all line endings to \n
binding = convertLineEndings(binding)
expected = convertLineEndings(expected)
if diff := cmp.Diff(expected, binding); diff != "" { if diff := cmp.Diff(expected, binding); diff != "" {
err = os.WriteFile(tt.dir+"/bindings_"+name+".got.js", []byte(binding), 0644) err = os.WriteFile(tt.dir+"/bindings_"+name+".got.js", []byte(binding), 0644)
if err != nil { if err != nil {

View File

@ -4,6 +4,7 @@ import (
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"os" "os"
"path/filepath" "path/filepath"
"strings"
"testing" "testing"
) )
@ -63,8 +64,10 @@ func TestGenerateModels(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("GenerateModels() error = %v", err) t.Fatalf("GenerateModels() error = %v", err)
} }
// convert all line endings to \n
if diff := cmp.Diff(tt.want, got); diff != "" { got = convertLineEndings(got)
want := convertLineEndings(tt.want)
if diff := cmp.Diff(want, got); diff != "" {
err = os.WriteFile(filepath.Join(tt.dir, "models.got.ts"), []byte(got), 0644) err = os.WriteFile(filepath.Join(tt.dir, "models.got.ts"), []byte(got), 0644)
if err != nil { if err != nil {
t.Errorf("os.WriteFile() error = %v", err) t.Errorf("os.WriteFile() error = %v", err)
@ -75,3 +78,8 @@ func TestGenerateModels(t *testing.T) {
}) })
} }
} }
func convertLineEndings(str string) string {
// replace all \r\n with \n
return strings.ReplaceAll(str, "\r\n", "\n")
}

View File

@ -40,6 +40,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
{ {
Name: "NoInputsStringOut", Name: "NoInputsStringOut",
@ -53,6 +54,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1075577233,
}, },
{ {
Name: "StringArrayInputStringOut", Name: "StringArrayInputStringOut",
@ -72,6 +74,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1091960237,
}, },
{ {
Name: "StringArrayInputStringArrayOut", Name: "StringArrayInputStringArrayOut",
@ -92,6 +95,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 383995060,
}, },
{ {
Name: "StringArrayInputNamedOutput", Name: "StringArrayInputNamedOutput",
@ -113,6 +117,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3678582682,
}, },
{ {
Name: "StringArrayInputNamedOutputs", Name: "StringArrayInputNamedOutputs",
@ -140,6 +145,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 319259595,
}, },
{ {
Name: "IntPointerInputNamedOutputs", Name: "IntPointerInputNamedOutputs",
@ -166,6 +172,7 @@ func TestParseDirectory(t *testing.T) {
Name: "error", Name: "error",
}}, }},
}, },
ID: 2718999663,
}, },
{ {
Name: "UIntPointerInAndOutput", Name: "UIntPointerInAndOutput",
@ -186,6 +193,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1367187362,
}, },
{ {
Name: "UInt8PointerInAndOutput", Name: "UInt8PointerInAndOutput",
@ -206,6 +214,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 518250834,
}, },
{ {
Name: "UInt16PointerInAndOutput", Name: "UInt16PointerInAndOutput",
@ -226,6 +235,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1236957573,
}, },
{ {
Name: "UInt32PointerInAndOutput", Name: "UInt32PointerInAndOutput",
@ -246,6 +256,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1739300671,
}, },
{ {
Name: "UInt64PointerInAndOutput", Name: "UInt64PointerInAndOutput",
@ -266,6 +277,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1403757716,
}, },
{ {
Name: "IntPointerInAndOutput", Name: "IntPointerInAndOutput",
@ -286,6 +298,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1066151743,
}, },
{ {
Name: "Int8PointerInAndOutput", Name: "Int8PointerInAndOutput",
@ -306,6 +319,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2189402897,
}, },
{ {
Name: "Int16PointerInAndOutput", Name: "Int16PointerInAndOutput",
@ -326,6 +340,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1754277916,
}, },
{ {
Name: "Int32PointerInAndOutput", Name: "Int32PointerInAndOutput",
@ -346,6 +361,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 4251088558,
}, },
{ {
Name: "Int64PointerInAndOutput", Name: "Int64PointerInAndOutput",
@ -366,6 +382,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2205561041,
}, },
{ {
Name: "IntInIntOut", Name: "IntInIntOut",
@ -384,6 +401,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 642881729,
}, },
{ {
Name: "Int8InIntOut", Name: "Int8InIntOut",
@ -402,6 +420,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 572240879,
}, },
{ {
Name: "Int16InIntOut", Name: "Int16InIntOut",
@ -420,6 +439,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3306292566,
}, },
{ {
Name: "Int32InIntOut", Name: "Int32InIntOut",
@ -438,6 +458,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1909469092,
}, },
{ {
Name: "Int64InIntOut", Name: "Int64InIntOut",
@ -456,6 +477,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1343888303,
}, },
{ {
Name: "UIntInUIntOut", Name: "UIntInUIntOut",
@ -474,6 +496,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2836661285,
}, },
{ {
Name: "UInt8InUIntOut", Name: "UInt8InUIntOut",
@ -492,6 +515,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2988345717,
}, },
{ {
Name: "UInt16InUIntOut", Name: "UInt16InUIntOut",
@ -510,6 +534,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3401034892,
}, },
{ {
Name: "UInt32InUIntOut", Name: "UInt32InUIntOut",
@ -528,6 +553,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1160383782,
}, },
{ {
Name: "UInt64InUIntOut", Name: "UInt64InUIntOut",
@ -546,6 +572,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 793803239,
}, },
{ {
Name: "Float32InFloat32Out", Name: "Float32InFloat32Out",
@ -564,6 +591,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3132595881,
}, },
{ {
Name: "Float64InFloat64Out", Name: "Float64InFloat64Out",
@ -582,6 +610,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2182412247,
}, },
{ {
Name: "PointerFloat32InFloat32Out", Name: "PointerFloat32InFloat32Out",
@ -602,6 +631,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 224675106,
}, },
{ {
Name: "PointerFloat64InFloat64Out", Name: "PointerFloat64InFloat64Out",
@ -622,6 +652,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2124953624,
}, },
{ {
Name: "BoolInBoolOut", Name: "BoolInBoolOut",
@ -640,6 +671,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2424639793,
}, },
{ {
Name: "PointerBoolInBoolOut", Name: "PointerBoolInBoolOut",
@ -660,6 +692,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3589606958,
}, },
{ {
Name: "PointerStringInStringOut", Name: "PointerStringInStringOut",
@ -680,6 +713,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 229603958,
}, },
{ {
Name: "StructPointerInputErrorOutput", Name: "StructPointerInputErrorOutput",
@ -701,6 +735,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2447692557,
}, },
{ {
Name: "StructInputStructOutput", Name: "StructInputStructOutput",
@ -723,6 +758,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3835643147,
}, },
{ {
Name: "StructPointerInputStructPointerOutput", Name: "StructPointerInputStructPointerOutput",
@ -747,6 +783,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2943477349,
}, },
{ {
Name: "MapIntInt", Name: "MapIntInt",
@ -764,6 +801,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2386486356,
}, },
{ {
Name: "PointerMapIntInt", Name: "PointerMapIntInt",
@ -782,6 +820,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3516977899,
}, },
{ {
Name: "MapIntPointerInt", Name: "MapIntPointerInt",
@ -800,6 +839,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 550413585,
}, },
{ {
Name: "MapIntSliceInt", Name: "MapIntSliceInt",
@ -818,6 +858,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2900172572,
}, },
{ {
Name: "MapIntSliceIntInMapIntSliceIntOut", Name: "MapIntSliceIntInMapIntSliceIntOut",
@ -851,6 +892,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 881980169,
}, },
{ {
Name: "ArrayInt", Name: "ArrayInt",
@ -863,6 +905,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3862002418,
}, },
}, },
}, },
@ -956,11 +999,13 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
}, },
"OtherService": { "OtherService": {
{ {
Name: "Hello", Name: "Hello",
ID: 4249972365,
}, },
}, },
}, },
@ -992,11 +1037,13 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
}, },
"OtherService": { "OtherService": {
{ {
Name: "Hello", Name: "Hello",
ID: 4249972365,
}, },
}, },
}, },
@ -1029,6 +1076,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
{ {
Name: "NewPerson", Name: "NewPerson",
@ -1052,6 +1100,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1661412647,
}, },
}, },
}, },
@ -1069,6 +1118,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 469445984,
}, },
}, },
}, },
@ -1149,6 +1199,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
}, },
}, },
@ -1180,6 +1231,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
}, },
}, },
@ -1211,6 +1263,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
{ {
Name: "NewPerson", Name: "NewPerson",
@ -1234,6 +1287,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1661412647,
}, },
}, },
}, },
@ -1251,6 +1305,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 302702907,
}, },
}, },
}, },
@ -1331,6 +1386,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
}, },
}, },
@ -1362,6 +1418,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
{ {
Name: "NewPerson", Name: "NewPerson",
@ -1385,6 +1442,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1661412647,
}, },
}, },
}, },
@ -1402,6 +1460,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 302702907,
}, },
}, },
}, },

View File

@ -4,14 +4,9 @@
import {main} from './models'; import {main} from './models';
function GreetService(method) { window.go = window.go || {};
return { window.go.main = {
packageName: "main", GreetService: {
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* GreetService.Greet * GreetService.Greet
@ -19,9 +14,7 @@ function GreetService(method) {
* @param name {string} * @param name {string}
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
function Greet(name) { Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Greet", name));
}
/** /**
* GreetService.NewPerson * GreetService.NewPerson
@ -29,15 +22,7 @@ function Greet(name) {
* @param name {string} * @param name {string}
* @returns {Promise<main.Person | null>} * @returns {Promise<main.Person | null>}
**/ **/
function NewPerson(name) { NewPerson: function(name) { wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("NewPerson", name));
}
window.go = window.go || {};
window.go.main = {
GreetService: {
Greet,
NewPerson,
}, },
}; };

View File

@ -4,14 +4,9 @@
import {services} from './models'; import {services} from './models';
function OtherService(method) { window.go = window.go || {};
return { window.go.services = {
packageName: "services", OtherService: {
serviceName: "OtherService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* OtherService.Yay * OtherService.Yay
@ -19,14 +14,7 @@ function OtherService(method) {
* *
* @returns {Promise<services.Address | null>} * @returns {Promise<services.Address | null>}
**/ **/
function Yay() { Yay: function() { wails.CallByID(302702907, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(OtherService("Yay"));
}
window.go = window.go || {};
window.go.services = {
OtherService: {
Yay,
}, },
}; };

View File

@ -2,14 +2,10 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT // This file is automatically generated. DO NOT EDIT
function GreetService(method) {
return { window.go = window.go || {};
packageName: "main", window.go.main = {
serviceName: "GreetService", GreetService: {
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* GreetService.Greet * GreetService.Greet
@ -17,17 +13,9 @@ function GreetService(method) {
* @param name {string} * @param name {string}
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
function Greet(name) { Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Greet", name)); },
} OtherService: {
function OtherService(method) {
return {
packageName: "main",
serviceName: "OtherService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* OtherService.Hello * OtherService.Hello
@ -35,16 +23,6 @@ function OtherService(method) {
* *
* @returns {Promise<void>} * @returns {Promise<void>}
**/ **/
function Hello() { Hello: function() { wails.CallByID(4249972365, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(OtherService("Hello"));
}
window.go = window.go || {};
window.go.main = {
GreetService: {
Greet,
},
OtherService: {
Hello,
}, },
}; };

View File

@ -2,14 +2,10 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT // This file is automatically generated. DO NOT EDIT
function GreetService(method) {
return { window.go = window.go || {};
packageName: "main", window.go.main = {
serviceName: "GreetService", GreetService: {
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* GreetService.Greet * GreetService.Greet
@ -17,17 +13,9 @@ function GreetService(method) {
* @param name {string} * @param name {string}
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
function Greet(name) { Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Greet", name)); },
} OtherService: {
function OtherService(method) {
return {
packageName: "main",
serviceName: "OtherService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* OtherService.Hello * OtherService.Hello
@ -35,16 +23,6 @@ function OtherService(method) {
* *
* @returns {Promise<void>} * @returns {Promise<void>}
**/ **/
function Hello() { Hello: function() { wails.CallByID(4249972365, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(OtherService("Hello"));
}
window.go = window.go || {};
window.go.main = {
GreetService: {
Greet,
},
OtherService: {
Hello,
}, },
}; };

View File

@ -4,14 +4,9 @@
import {main} from './models'; import {main} from './models';
function GreetService(method) { window.go = window.go || {};
return { window.go.main = {
packageName: "main", GreetService: {
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* GreetService.Greet * GreetService.Greet
@ -19,9 +14,7 @@ function GreetService(method) {
* @param name {string} * @param name {string}
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
function Greet(name) { Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Greet", name));
}
/** /**
* GreetService.NewPerson * GreetService.NewPerson
@ -29,15 +22,7 @@ function Greet(name) {
* @param name {string} * @param name {string}
* @returns {Promise<main.Person | null>} * @returns {Promise<main.Person | null>}
**/ **/
function NewPerson(name) { NewPerson: function(name) { wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("NewPerson", name));
}
window.go = window.go || {};
window.go.main = {
GreetService: {
Greet,
NewPerson,
}, },
}; };

View File

@ -4,14 +4,9 @@
import {services} from './models'; import {services} from './models';
function OtherService(method) { window.go = window.go || {};
return { window.go.services = {
packageName: "services", OtherService: {
serviceName: "OtherService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* OtherService.Yay * OtherService.Yay
@ -19,14 +14,7 @@ function OtherService(method) {
* *
* @returns {Promise<services.Address | null>} * @returns {Promise<services.Address | null>}
**/ **/
function Yay() { Yay: function() { wails.CallByID(469445984, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(OtherService("Yay"));
}
window.go = window.go || {};
window.go.services = {
OtherService: {
Yay,
}, },
}; };

View File

@ -4,14 +4,9 @@
import {main} from './models'; import {main} from './models';
function GreetService(method) { window.go = window.go || {};
return { window.go.main = {
packageName: "main", GreetService: {
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* GreetService.ArrayInt * GreetService.ArrayInt
@ -19,9 +14,7 @@ function GreetService(method) {
* @param _in {number[]} * @param _in {number[]}
* @returns {Promise<void>} * @returns {Promise<void>}
**/ **/
function ArrayInt(_in) { ArrayInt: function(_in) { wails.CallByID(3862002418, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("ArrayInt", _in));
}
/** /**
* GreetService.BoolInBoolOut * GreetService.BoolInBoolOut
@ -29,9 +22,7 @@ function ArrayInt(_in) {
* @param _in {boolean} * @param _in {boolean}
* @returns {Promise<boolean>} * @returns {Promise<boolean>}
**/ **/
function BoolInBoolOut(_in) { BoolInBoolOut: function(_in) { wails.CallByID(2424639793, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("BoolInBoolOut", _in));
}
/** /**
* GreetService.Float32InFloat32Out * GreetService.Float32InFloat32Out
@ -39,9 +30,7 @@ function BoolInBoolOut(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function Float32InFloat32Out(_in) { Float32InFloat32Out: function(_in) { wails.CallByID(3132595881, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Float32InFloat32Out", _in));
}
/** /**
* GreetService.Float64InFloat64Out * GreetService.Float64InFloat64Out
@ -49,9 +38,7 @@ function Float32InFloat32Out(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function Float64InFloat64Out(_in) { Float64InFloat64Out: function(_in) { wails.CallByID(2182412247, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Float64InFloat64Out", _in));
}
/** /**
* GreetService.Greet * GreetService.Greet
@ -59,9 +46,7 @@ function Float64InFloat64Out(_in) {
* @param name {string} * @param name {string}
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
function Greet(name) { Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Greet", name));
}
/** /**
* GreetService.Int16InIntOut * GreetService.Int16InIntOut
@ -69,9 +54,7 @@ function Greet(name) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function Int16InIntOut(_in) { Int16InIntOut: function(_in) { wails.CallByID(3306292566, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Int16InIntOut", _in));
}
/** /**
* GreetService.Int16PointerInAndOutput * GreetService.Int16PointerInAndOutput
@ -79,9 +62,7 @@ function Int16InIntOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function Int16PointerInAndOutput(_in) { Int16PointerInAndOutput: function(_in) { wails.CallByID(1754277916, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Int16PointerInAndOutput", _in));
}
/** /**
* GreetService.Int32InIntOut * GreetService.Int32InIntOut
@ -89,9 +70,7 @@ function Int16PointerInAndOutput(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function Int32InIntOut(_in) { Int32InIntOut: function(_in) { wails.CallByID(1909469092, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Int32InIntOut", _in));
}
/** /**
* GreetService.Int32PointerInAndOutput * GreetService.Int32PointerInAndOutput
@ -99,9 +78,7 @@ function Int32InIntOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function Int32PointerInAndOutput(_in) { Int32PointerInAndOutput: function(_in) { wails.CallByID(4251088558, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Int32PointerInAndOutput", _in));
}
/** /**
* GreetService.Int64InIntOut * GreetService.Int64InIntOut
@ -109,9 +86,7 @@ function Int32PointerInAndOutput(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function Int64InIntOut(_in) { Int64InIntOut: function(_in) { wails.CallByID(1343888303, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Int64InIntOut", _in));
}
/** /**
* GreetService.Int64PointerInAndOutput * GreetService.Int64PointerInAndOutput
@ -119,9 +94,7 @@ function Int64InIntOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function Int64PointerInAndOutput(_in) { Int64PointerInAndOutput: function(_in) { wails.CallByID(2205561041, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Int64PointerInAndOutput", _in));
}
/** /**
* GreetService.Int8InIntOut * GreetService.Int8InIntOut
@ -129,9 +102,7 @@ function Int64PointerInAndOutput(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function Int8InIntOut(_in) { Int8InIntOut: function(_in) { wails.CallByID(572240879, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Int8InIntOut", _in));
}
/** /**
* GreetService.Int8PointerInAndOutput * GreetService.Int8PointerInAndOutput
@ -139,9 +110,7 @@ function Int8InIntOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function Int8PointerInAndOutput(_in) { Int8PointerInAndOutput: function(_in) { wails.CallByID(2189402897, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Int8PointerInAndOutput", _in));
}
/** /**
* GreetService.IntInIntOut * GreetService.IntInIntOut
@ -149,9 +118,7 @@ function Int8PointerInAndOutput(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function IntInIntOut(_in) { IntInIntOut: function(_in) { wails.CallByID(642881729, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("IntInIntOut", _in));
}
/** /**
* GreetService.IntPointerInAndOutput * GreetService.IntPointerInAndOutput
@ -159,9 +126,7 @@ function IntInIntOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function IntPointerInAndOutput(_in) { IntPointerInAndOutput: function(_in) { wails.CallByID(1066151743, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("IntPointerInAndOutput", _in));
}
/** /**
* GreetService.IntPointerInputNamedOutputs * GreetService.IntPointerInputNamedOutputs
@ -169,9 +134,7 @@ function IntPointerInAndOutput(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null, void>} * @returns {Promise<number | null, void>}
**/ **/
function IntPointerInputNamedOutputs(_in) { IntPointerInputNamedOutputs: function(_in) { wails.CallByID(2718999663, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("IntPointerInputNamedOutputs", _in));
}
/** /**
* GreetService.MapIntInt * GreetService.MapIntInt
@ -179,9 +142,7 @@ function IntPointerInputNamedOutputs(_in) {
* @param _in {map} * @param _in {map}
* @returns {Promise<void>} * @returns {Promise<void>}
**/ **/
function MapIntInt(_in) { MapIntInt: function(_in) { wails.CallByID(2386486356, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("MapIntInt", _in));
}
/** /**
* GreetService.MapIntPointerInt * GreetService.MapIntPointerInt
@ -189,9 +150,7 @@ function MapIntInt(_in) {
* @param _in {map} * @param _in {map}
* @returns {Promise<void>} * @returns {Promise<void>}
**/ **/
function MapIntPointerInt(_in) { MapIntPointerInt: function(_in) { wails.CallByID(550413585, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("MapIntPointerInt", _in));
}
/** /**
* GreetService.MapIntSliceInt * GreetService.MapIntSliceInt
@ -199,9 +158,7 @@ function MapIntPointerInt(_in) {
* @param _in {map} * @param _in {map}
* @returns {Promise<void>} * @returns {Promise<void>}
**/ **/
function MapIntSliceInt(_in) { MapIntSliceInt: function(_in) { wails.CallByID(2900172572, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("MapIntSliceInt", _in));
}
/** /**
* GreetService.MapIntSliceIntInMapIntSliceIntOut * GreetService.MapIntSliceIntInMapIntSliceIntOut
@ -209,9 +166,7 @@ function MapIntSliceInt(_in) {
* @param _in {map} * @param _in {map}
* @returns {Promise<map>} * @returns {Promise<map>}
**/ **/
function MapIntSliceIntInMapIntSliceIntOut(_in) { MapIntSliceIntInMapIntSliceIntOut: function(_in) { wails.CallByID(881980169, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("MapIntSliceIntInMapIntSliceIntOut", _in));
}
/** /**
* GreetService.NoInputsStringOut * GreetService.NoInputsStringOut
@ -219,9 +174,7 @@ function MapIntSliceIntInMapIntSliceIntOut(_in) {
* *
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
function NoInputsStringOut() { NoInputsStringOut: function() { wails.CallByID(1075577233, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("NoInputsStringOut"));
}
/** /**
* GreetService.PointerBoolInBoolOut * GreetService.PointerBoolInBoolOut
@ -229,9 +182,7 @@ function NoInputsStringOut() {
* @param _in {boolean | null} * @param _in {boolean | null}
* @returns {Promise<boolean | null>} * @returns {Promise<boolean | null>}
**/ **/
function PointerBoolInBoolOut(_in) { PointerBoolInBoolOut: function(_in) { wails.CallByID(3589606958, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("PointerBoolInBoolOut", _in));
}
/** /**
* GreetService.PointerFloat32InFloat32Out * GreetService.PointerFloat32InFloat32Out
@ -239,9 +190,7 @@ function PointerBoolInBoolOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function PointerFloat32InFloat32Out(_in) { PointerFloat32InFloat32Out: function(_in) { wails.CallByID(224675106, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("PointerFloat32InFloat32Out", _in));
}
/** /**
* GreetService.PointerFloat64InFloat64Out * GreetService.PointerFloat64InFloat64Out
@ -249,9 +198,7 @@ function PointerFloat32InFloat32Out(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function PointerFloat64InFloat64Out(_in) { PointerFloat64InFloat64Out: function(_in) { wails.CallByID(2124953624, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("PointerFloat64InFloat64Out", _in));
}
/** /**
* GreetService.PointerMapIntInt * GreetService.PointerMapIntInt
@ -259,9 +206,7 @@ function PointerFloat64InFloat64Out(_in) {
* @param _in {map | null} * @param _in {map | null}
* @returns {Promise<void>} * @returns {Promise<void>}
**/ **/
function PointerMapIntInt(_in) { PointerMapIntInt: function(_in) { wails.CallByID(3516977899, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("PointerMapIntInt", _in));
}
/** /**
* GreetService.PointerStringInStringOut * GreetService.PointerStringInStringOut
@ -269,9 +214,7 @@ function PointerMapIntInt(_in) {
* @param _in {string | null} * @param _in {string | null}
* @returns {Promise<string | null>} * @returns {Promise<string | null>}
**/ **/
function PointerStringInStringOut(_in) { PointerStringInStringOut: function(_in) { wails.CallByID(229603958, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("PointerStringInStringOut", _in));
}
/** /**
* GreetService.StringArrayInputNamedOutput * GreetService.StringArrayInputNamedOutput
@ -279,9 +222,7 @@ function PointerStringInStringOut(_in) {
* @param _in {string[]} * @param _in {string[]}
* @returns {Promise<string[]>} * @returns {Promise<string[]>}
**/ **/
function StringArrayInputNamedOutput(_in) { StringArrayInputNamedOutput: function(_in) { wails.CallByID(3678582682, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("StringArrayInputNamedOutput", _in));
}
/** /**
* GreetService.StringArrayInputNamedOutputs * GreetService.StringArrayInputNamedOutputs
@ -289,9 +230,7 @@ function StringArrayInputNamedOutput(_in) {
* @param _in {string[]} * @param _in {string[]}
* @returns {Promise<string[], void>} * @returns {Promise<string[], void>}
**/ **/
function StringArrayInputNamedOutputs(_in) { StringArrayInputNamedOutputs: function(_in) { wails.CallByID(319259595, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("StringArrayInputNamedOutputs", _in));
}
/** /**
* GreetService.StringArrayInputStringArrayOut * GreetService.StringArrayInputStringArrayOut
@ -299,9 +238,7 @@ function StringArrayInputNamedOutputs(_in) {
* @param _in {string[]} * @param _in {string[]}
* @returns {Promise<string[]>} * @returns {Promise<string[]>}
**/ **/
function StringArrayInputStringArrayOut(_in) { StringArrayInputStringArrayOut: function(_in) { wails.CallByID(383995060, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("StringArrayInputStringArrayOut", _in));
}
/** /**
* GreetService.StringArrayInputStringOut * GreetService.StringArrayInputStringOut
@ -309,9 +246,7 @@ function StringArrayInputStringArrayOut(_in) {
* @param _in {string[]} * @param _in {string[]}
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
function StringArrayInputStringOut(_in) { StringArrayInputStringOut: function(_in) { wails.CallByID(1091960237, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("StringArrayInputStringOut", _in));
}
/** /**
* GreetService.StructInputStructOutput * GreetService.StructInputStructOutput
@ -319,9 +254,7 @@ function StringArrayInputStringOut(_in) {
* @param _in {main.Person} * @param _in {main.Person}
* @returns {Promise<main.Person>} * @returns {Promise<main.Person>}
**/ **/
function StructInputStructOutput(_in) { StructInputStructOutput: function(_in) { wails.CallByID(3835643147, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("StructInputStructOutput", _in));
}
/** /**
* GreetService.StructPointerInputErrorOutput * GreetService.StructPointerInputErrorOutput
@ -329,9 +262,7 @@ function StructInputStructOutput(_in) {
* @param _in {main.Person | null} * @param _in {main.Person | null}
* @returns {Promise<void>} * @returns {Promise<void>}
**/ **/
function StructPointerInputErrorOutput(_in) { StructPointerInputErrorOutput: function(_in) { wails.CallByID(2447692557, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("StructPointerInputErrorOutput", _in));
}
/** /**
* GreetService.StructPointerInputStructPointerOutput * GreetService.StructPointerInputStructPointerOutput
@ -339,9 +270,7 @@ function StructPointerInputErrorOutput(_in) {
* @param _in {main.Person | null} * @param _in {main.Person | null}
* @returns {Promise<main.Person | null>} * @returns {Promise<main.Person | null>}
**/ **/
function StructPointerInputStructPointerOutput(_in) { StructPointerInputStructPointerOutput: function(_in) { wails.CallByID(2943477349, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("StructPointerInputStructPointerOutput", _in));
}
/** /**
* GreetService.UInt16InUIntOut * GreetService.UInt16InUIntOut
@ -349,9 +278,7 @@ function StructPointerInputStructPointerOutput(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function UInt16InUIntOut(_in) { UInt16InUIntOut: function(_in) { wails.CallByID(3401034892, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("UInt16InUIntOut", _in));
}
/** /**
* GreetService.UInt16PointerInAndOutput * GreetService.UInt16PointerInAndOutput
@ -359,9 +286,7 @@ function UInt16InUIntOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function UInt16PointerInAndOutput(_in) { UInt16PointerInAndOutput: function(_in) { wails.CallByID(1236957573, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("UInt16PointerInAndOutput", _in));
}
/** /**
* GreetService.UInt32InUIntOut * GreetService.UInt32InUIntOut
@ -369,9 +294,7 @@ function UInt16PointerInAndOutput(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function UInt32InUIntOut(_in) { UInt32InUIntOut: function(_in) { wails.CallByID(1160383782, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("UInt32InUIntOut", _in));
}
/** /**
* GreetService.UInt32PointerInAndOutput * GreetService.UInt32PointerInAndOutput
@ -379,9 +302,7 @@ function UInt32InUIntOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function UInt32PointerInAndOutput(_in) { UInt32PointerInAndOutput: function(_in) { wails.CallByID(1739300671, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("UInt32PointerInAndOutput", _in));
}
/** /**
* GreetService.UInt64InUIntOut * GreetService.UInt64InUIntOut
@ -389,9 +310,7 @@ function UInt32PointerInAndOutput(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function UInt64InUIntOut(_in) { UInt64InUIntOut: function(_in) { wails.CallByID(793803239, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("UInt64InUIntOut", _in));
}
/** /**
* GreetService.UInt64PointerInAndOutput * GreetService.UInt64PointerInAndOutput
@ -399,9 +318,7 @@ function UInt64InUIntOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function UInt64PointerInAndOutput(_in) { UInt64PointerInAndOutput: function(_in) { wails.CallByID(1403757716, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("UInt64PointerInAndOutput", _in));
}
/** /**
* GreetService.UInt8InUIntOut * GreetService.UInt8InUIntOut
@ -409,9 +326,7 @@ function UInt64PointerInAndOutput(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function UInt8InUIntOut(_in) { UInt8InUIntOut: function(_in) { wails.CallByID(2988345717, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("UInt8InUIntOut", _in));
}
/** /**
* GreetService.UInt8PointerInAndOutput * GreetService.UInt8PointerInAndOutput
@ -419,9 +334,7 @@ function UInt8InUIntOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function UInt8PointerInAndOutput(_in) { UInt8PointerInAndOutput: function(_in) { wails.CallByID(518250834, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("UInt8PointerInAndOutput", _in));
}
/** /**
* GreetService.UIntInUIntOut * GreetService.UIntInUIntOut
@ -429,9 +342,7 @@ function UInt8PointerInAndOutput(_in) {
* @param _in {number} * @param _in {number}
* @returns {Promise<number>} * @returns {Promise<number>}
**/ **/
function UIntInUIntOut(_in) { UIntInUIntOut: function(_in) { wails.CallByID(2836661285, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("UIntInUIntOut", _in));
}
/** /**
* GreetService.UIntPointerInAndOutput * GreetService.UIntPointerInAndOutput
@ -439,56 +350,7 @@ function UIntInUIntOut(_in) {
* @param _in {number | null} * @param _in {number | null}
* @returns {Promise<number | null>} * @returns {Promise<number | null>}
**/ **/
function UIntPointerInAndOutput(_in) { UIntPointerInAndOutput: function(_in) { wails.CallByID(1367187362, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("UIntPointerInAndOutput", _in));
}
window.go = window.go || {};
window.go.main = {
GreetService: {
ArrayInt,
BoolInBoolOut,
Float32InFloat32Out,
Float64InFloat64Out,
Greet,
Int16InIntOut,
Int16PointerInAndOutput,
Int32InIntOut,
Int32PointerInAndOutput,
Int64InIntOut,
Int64PointerInAndOutput,
Int8InIntOut,
Int8PointerInAndOutput,
IntInIntOut,
IntPointerInAndOutput,
IntPointerInputNamedOutputs,
MapIntInt,
MapIntPointerInt,
MapIntSliceInt,
MapIntSliceIntInMapIntSliceIntOut,
NoInputsStringOut,
PointerBoolInBoolOut,
PointerFloat32InFloat32Out,
PointerFloat64InFloat64Out,
PointerMapIntInt,
PointerStringInStringOut,
StringArrayInputNamedOutput,
StringArrayInputNamedOutputs,
StringArrayInputStringArrayOut,
StringArrayInputStringOut,
StructInputStructOutput,
StructPointerInputErrorOutput,
StructPointerInputStructPointerOutput,
UInt16InUIntOut,
UInt16PointerInAndOutput,
UInt32InUIntOut,
UInt32PointerInAndOutput,
UInt64InUIntOut,
UInt64PointerInAndOutput,
UInt8InUIntOut,
UInt8PointerInAndOutput,
UIntInUIntOut,
UIntPointerInAndOutput,
}, },
}; };

View File

@ -2,14 +2,10 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT // This file is automatically generated. DO NOT EDIT
function GreetService(method) {
return { window.go = window.go || {};
packageName: "main", window.go.main = {
serviceName: "GreetService", GreetService: {
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* GreetService.Greet * GreetService.Greet
@ -17,13 +13,6 @@ function GreetService(method) {
* @param name {string} * @param name {string}
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
function Greet(name) { Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Greet", name));
}
window.go = window.go || {};
window.go.main = {
GreetService: {
Greet,
}, },
}; };

View File

@ -2,14 +2,10 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT // This file is automatically generated. DO NOT EDIT
function GreetService(method) {
return { window.go = window.go || {};
packageName: "main", window.go.main = {
serviceName: "GreetService", GreetService: {
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* GreetService.Greet * GreetService.Greet
@ -17,13 +13,6 @@ function GreetService(method) {
* @param name {string} * @param name {string}
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
function Greet(name) { Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Greet", name));
}
window.go = window.go || {};
window.go.main = {
GreetService: {
Greet,
}, },
}; };

View File

@ -4,14 +4,9 @@
import {main} from './models'; import {main} from './models';
function GreetService(method) { window.go = window.go || {};
return { window.go.main = {
packageName: "main", GreetService: {
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* GreetService.Greet * GreetService.Greet
@ -19,9 +14,7 @@ function GreetService(method) {
* @param name {string} * @param name {string}
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
function Greet(name) { Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("Greet", name));
}
/** /**
* GreetService.NewPerson * GreetService.NewPerson
@ -29,15 +22,7 @@ function Greet(name) {
* @param name {string} * @param name {string}
* @returns {Promise<main.Person | null>} * @returns {Promise<main.Person | null>}
**/ **/
function NewPerson(name) { NewPerson: function(name) { wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(GreetService("NewPerson", name));
}
window.go = window.go || {};
window.go.main = {
GreetService: {
Greet,
NewPerson,
}, },
}; };

View File

@ -4,14 +4,9 @@
import {services} from './models'; import {services} from './models';
function OtherService(method) { window.go = window.go || {};
return { window.go.services = {
packageName: "services", OtherService: {
serviceName: "OtherService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/** /**
* OtherService.Yay * OtherService.Yay
@ -19,14 +14,7 @@ function OtherService(method) {
* *
* @returns {Promise<services.Address | null>} * @returns {Promise<services.Address | null>}
**/ **/
function Yay() { Yay: function() { wails.CallByID(302702907, ...Array.prototype.slice.call(arguments, 0)); },
return wails.Call(OtherService("Yay"));
}
window.go = window.go || {};
window.go.services = {
OtherService: {
Yay,
}, },
}; };

View File

@ -1,14 +1,14 @@
package templates package templates
import ( import (
"os"
"testing" "testing"
"github.com/wailsapp/wails/v3/internal/flags" "github.com/wailsapp/wails/v3/internal/flags"
) )
func TestInstall(t *testing.T) { func TestInstall(t *testing.T) {
type args struct {
}
tests := []struct { tests := []struct {
name string name string
options *flags.Init options *flags.Init
@ -25,6 +25,10 @@ func TestInstall(t *testing.T) {
}, },
} }
for _, tt := range tests { for _, tt := range tests {
// Remove test directory if it exists
if _, err := os.Stat(tt.options.ProjectName); err == nil {
_ = os.RemoveAll(tt.options.ProjectName)
}
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
if err := Install(tt.options); (err != nil) != tt.wantErr { if err := Install(tt.options); (err != nil) != tt.wantErr {
t.Errorf("Install() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("Install() error = %v, wantErr %v", err, tt.wantErr)