新增调试信息
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
/*
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// Import the function from the DLL
|
||||
char* parseCli(int argc, char** argv);
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := os.Args
|
||||
|
||||
// Convert []string to []*C.char
|
||||
var cArgs []*C.char
|
||||
for _, arg := range args {
|
||||
cArgs = append(cArgs, C.CString(arg))
|
||||
}
|
||||
defer func() {
|
||||
for _, arg := range cArgs {
|
||||
C.free(unsafe.Pointer(arg))
|
||||
}
|
||||
}()
|
||||
|
||||
// Call the C function
|
||||
result := C.parseCli(C.int(len(cArgs)), (**C.char)(unsafe.Pointer(&cArgs[0])))
|
||||
fmt.Println(C.GoString(result))
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/hiddify/hiddify-core/cmd"
|
||||
)
|
||||
|
||||
type UpdateRequest struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
PrivatePods bool `json:"private_pods"`
|
||||
OperatingMode string `json:"operating_mode,omitempty"`
|
||||
ActivationState string `json:"activation_state,omitempty"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
cmd.ParseCli(os.Args[1:])
|
||||
|
||||
// var request UpdateRequest
|
||||
// // jsonTag, err2 := validation.ErrorFieldName(&request, &request.OperatingMode)
|
||||
// jsonTag, err2 := request.ValName(&request.OperatingMode)
|
||||
|
||||
// fmt.Println(jsonTag, err2)
|
||||
// RegisterExtension("com.example.extension", NewExampleExtension())
|
||||
// ex := extensionsMap["com.example.extension"].(*Extension[struct])
|
||||
// fmt.Println(NewExampleExtension().Get())
|
||||
|
||||
// fmt.Println(ex.Get())
|
||||
}
|
||||
Reference in New Issue
Block a user