diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 12eee8a..8d8bf67 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -20,15 +20,15 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Initialize CodeQL
- uses: github/codeql-action/init@v2
+ uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
- uses: github/codeql-action/autobuild@v2
+ uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v2
+ uses: github/codeql-action/analyze@v3
diff --git a/LICENSE b/LICENSE
index 38e031d..406c22b 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
BSD 3-Clause License
-Copyright (c) 2020 - 2021, xuri
+Copyright (c) 2020 - 2024, xuri
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/README.md b/README.md
index f04fbbb..90543a3 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
-
+
@@ -15,7 +15,7 @@
## Introduction
-xgen is a library written in pure Go providing a set of functions that allow you to parse XSD (XML schema definition) files. This library needs Go version 1.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [go.dev](https://pkg.go.dev/github.com/xuri/xgen?tab=doc).
+xgen is a library written in pure Go providing a set of functions that allow you to parse XSD (XML schema definition) files. This library needs Go version 1.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [go.dev](https://pkg.go.dev/github.com/xuri/xgen).
`xgen` commands automatically compiles XML schema files into the multi-language type or class declarations code.
diff --git a/README_zh.md b/README_zh.md
index d828f70..d1c232d 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -6,7 +6,7 @@
-
+
@@ -15,7 +15,7 @@
## Introduction
-xgen 是 Go 语言编写的 XSD (XML Schema Definition) 工具基础库。使用本基础库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [go.dev](https://pkg.go.dev/github.com/xuri/xgen?tab=doc)。
+xgen 是 Go 语言编写的 XSD (XML Schema Definition) 工具基础库。使用本基础库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [go.dev](https://pkg.go.dev/github.com/xuri/xgen)。
`xgen` 命令可将 XML 模式定义文件编译为多语言类型或类声明的代码。
@@ -24,13 +24,13 @@ xgen 是 Go 语言编写的 XSD (XML Schema Definition) 工具基础库。使用
如果您使用的是 Go 1.17 及更高版本,请使用 `go install` 安装可执行文件
```sh
-去安装 github.com/xuri/xgen/cmd/xgen@latest
+go install github.com/xuri/xgen/cmd/xgen@latest
```
如果您使用的是 Go 1.16 及更早版本,请使用 `go get` 安装可执行文件
```sh
-去获取-u -v github.com/xuri/xgen/cmd/...
+go get -u -v github.com/xuri/xgen/cmd/...
```
下面的命令将遍历 `xsd` 目录中的 XML 模式定义文件,并在 `output` 目录中生成 Go 语言结构体声明代码。
diff --git a/genC.go b/genC.go
index 4d963b5..09e2a88 100644
--- a/genC.go
+++ b/genC.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/genGo.go b/genGo.go
index d62f00a..c27fa36 100644
--- a/genGo.go
+++ b/genGo.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/genJava.go b/genJava.go
index cefbdc2..70cbc87 100644
--- a/genJava.go
+++ b/genJava.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/genRust.go b/genRust.go
index 2bf8895..f3b9cb6 100644
--- a/genRust.go
+++ b/genRust.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/genTypeScript.go b/genTypeScript.go
index 31d7c0a..b5f9d38 100644
--- a/genTypeScript.go
+++ b/genTypeScript.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/parser.go b/parser.go
index 0c6ffb2..781c36a 100644
--- a/parser.go
+++ b/parser.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/parser_test.go b/parser_test.go
index 271a901..1fff0da 100644
--- a/parser_test.go
+++ b/parser_test.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
@@ -10,13 +10,14 @@ package xgen
import (
"fmt"
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
)
var (
@@ -38,9 +39,11 @@ func TestParseGoExternal(t *testing.T) {
// testParseForSource runs parsing tests for a given language. The sourceDirectory specifies the root of the
// input for the tests. The expected structure of the sourceDirectory is as follows:
-// source
-// ├── xsd (with the input xsd files to run through the parser)
-// └── (with the expected generated code named .
+//
+// source
+// ├── xsd (with the input xsd files to run through the parser)
+// └── (with the expected generated code named .
+//
// The test cleans up files it generates unless leaveOutput is set to true. In which case, the generate file is left
// on disk for manual inspection under //output.
func testParseForSource(t *testing.T, lang string, fileExt string, langDirName string, sourceDirectory string, leaveOutput bool) {
diff --git a/proto.go b/proto.go
index fa3c0ef..5af61e7 100644
--- a/proto.go
+++ b/proto.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
@@ -102,9 +102,9 @@ type Group struct {
// define if the elements it contains should be plural or not (as defined by the maxOccurs).
// https://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition_details
type Choice struct {
- ID string
- Choice []Choice
- Plural bool
+ ID string
+ Choice []Choice
+ Plural bool
}
// AttributeGroup definitions do not participate in ·validation· as such, but
diff --git a/schema.go b/schema.go
index d9f4681..de72f46 100644
--- a/schema.go
+++ b/schema.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/stack.go b/stack.go
index 82c067f..d6ac6d0 100644
--- a/stack.go
+++ b/stack.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlAttribute.go b/xmlAttribute.go
index e54b5e2..74adf1a 100644
--- a/xmlAttribute.go
+++ b/xmlAttribute.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlAttributeGroup.go b/xmlAttributeGroup.go
index b64d077..1e1cc57 100644
--- a/xmlAttributeGroup.go
+++ b/xmlAttributeGroup.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlCharData.go b/xmlCharData.go
index 7075733..f934af5 100644
--- a/xmlCharData.go
+++ b/xmlCharData.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlComplexType.go b/xmlComplexType.go
index 082a6cd..ff477e0 100644
--- a/xmlComplexType.go
+++ b/xmlComplexType.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlElement.go b/xmlElement.go
index 6157332..ffc3c84 100644
--- a/xmlElement.go
+++ b/xmlElement.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlEnumeration.go b/xmlEnumeration.go
index 09ba3d6..5bebc70 100644
--- a/xmlEnumeration.go
+++ b/xmlEnumeration.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlFractionDigits.go b/xmlFractionDigits.go
index 6771f5e..bbc87e9 100644
--- a/xmlFractionDigits.go
+++ b/xmlFractionDigits.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlGroup.go b/xmlGroup.go
index 0ea5c1a..2a463e6 100644
--- a/xmlGroup.go
+++ b/xmlGroup.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlImport.go b/xmlImport.go
index f5042e6..6fba2c6 100644
--- a/xmlImport.go
+++ b/xmlImport.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlInclude.go b/xmlInclude.go
index f57c1c1..6be1659 100644
--- a/xmlInclude.go
+++ b/xmlInclude.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlLength.go b/xmlLength.go
index 57dd438..d091fc3 100644
--- a/xmlLength.go
+++ b/xmlLength.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlList.go b/xmlList.go
index 73d1036..0d07154 100644
--- a/xmlList.go
+++ b/xmlList.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlMaxExclusive.go b/xmlMaxExclusive.go
index d2f7a08..d8c4d78 100644
--- a/xmlMaxExclusive.go
+++ b/xmlMaxExclusive.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlMaxInclusive.go b/xmlMaxInclusive.go
index 9a588b0..d50fac9 100644
--- a/xmlMaxInclusive.go
+++ b/xmlMaxInclusive.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlMaxLength.go b/xmlMaxLength.go
index c92c0e3..c0ee22e 100644
--- a/xmlMaxLength.go
+++ b/xmlMaxLength.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlMinExclusive.go b/xmlMinExclusive.go
index ab3464e..1f46897 100644
--- a/xmlMinExclusive.go
+++ b/xmlMinExclusive.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlMinInclusive.go b/xmlMinInclusive.go
index 6a51c76..a9bd4f0 100644
--- a/xmlMinInclusive.go
+++ b/xmlMinInclusive.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlMinLength.go b/xmlMinLength.go
index a1c2d17..b60ea67 100644
--- a/xmlMinLength.go
+++ b/xmlMinLength.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlPattern.go b/xmlPattern.go
index 3b14a3f..53d63ce 100644
--- a/xmlPattern.go
+++ b/xmlPattern.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlRestriction.go b/xmlRestriction.go
index 1247eea..8f2880c 100644
--- a/xmlRestriction.go
+++ b/xmlRestriction.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlSchema.go b/xmlSchema.go
index e8b19fa..79de1fe 100644
--- a/xmlSchema.go
+++ b/xmlSchema.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlSimpleType.go b/xmlSimpleType.go
index 9d7a1ff..45f9e25 100644
--- a/xmlSimpleType.go
+++ b/xmlSimpleType.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlTotalDigits.go b/xmlTotalDigits.go
index 753d5d4..ae4e7de 100644
--- a/xmlTotalDigits.go
+++ b/xmlTotalDigits.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlUnion.go b/xmlUnion.go
index 2545021..dce084f 100644
--- a/xmlUnion.go
+++ b/xmlUnion.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//
diff --git a/xmlWhiteSpace.go b/xmlWhiteSpace.go
index 1a3b3d9..4ec2b78 100644
--- a/xmlWhiteSpace.go
+++ b/xmlWhiteSpace.go
@@ -1,4 +1,4 @@
-// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
+// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
//