Skip to content

Commit d0691b7

Browse files
Fix incorrect README install command and update dependencies (#78)
1 parent 61e2702 commit d0691b7

39 files changed

+57
-54
lines changed

.github/workflows/codeql-analysis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ jobs:
2020

2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424

2525
- name: Initialize CodeQL
26-
uses: github/codeql-action/init@v2
26+
uses: github/codeql-action/init@v3
2727
with:
2828
languages: ${{ matrix.language }}
2929

3030
- name: Autobuild
31-
uses: github/codeql-action/autobuild@v2
31+
uses: github/codeql-action/autobuild@v3
3232

3333
- name: Perform CodeQL Analysis
34-
uses: github/codeql-action/analyze@v2
34+
uses: github/codeql-action/analyze@v3

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2020 - 2021, xuri
3+
Copyright (c) 2020 - 2024, xuri
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a href="https://github.com/xuri/xgen/actions?workflow=Go"><img src="https://github.com/xuri/xgen/workflows/Go/badge.svg?branch=master" alt="Build Status"></a>
77
<a href="https://codecov.io/gh/xuri/xgen"><img src="https://codecov.io/gh/xuri/xgen/branch/master/graph/badge.svg" alt="Code Coverage"></a>
88
<a href="https://goreportcard.com/report/github.com/xuri/xgen"><img src="https://goreportcard.com/badge/github.com/xuri/xgen" alt="Go Report Card"></a>
9-
<a href="https://pkg.go.dev/github.com/xuri/xgen?tab=doc"><img src="https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white" alt="go.dev"></a>
9+
<a href="https://pkg.go.dev/github.com/xuri/xgen"><img src="https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white" alt="go.dev"></a>
1010
<a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/license-bsd-orange.svg" alt="Licenses"></a>
1111
<a href="https://www.paypal.me/xuri"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate"></a>
1212
</p>
@@ -15,7 +15,7 @@
1515

1616
## Introduction
1717

18-
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).
18+
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).
1919

2020
`xgen` commands automatically compiles XML schema files into the multi-language type or class declarations code.
2121

README_zh.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a href="https://github.com/xuri/xgen/actions?workflow=Go"><img src="https://github.com/xuri/xgen/workflows/Go/badge.svg?branch=master" alt="Build Status"></a>
77
<a href="https://codecov.io/gh/xuri/xgen"><img src="https://codecov.io/gh/xuri/xgen/branch/master/graph/badge.svg" alt="Code Coverage"></a>
88
<a href="https://goreportcard.com/report/github.com/xuri/xgen"><img src="https://goreportcard.com/badge/github.com/xuri/xgen" alt="Go Report Card"></a>
9-
<a href="https://pkg.go.dev/github.com/xuri/xgen?tab=doc"><img src="https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white" alt="go.dev"></a>
9+
<a href="https://pkg.go.dev/github.com/xuri/xgen"><img src="https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white" alt="go.dev"></a>
1010
<a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/license-bsd-orange.svg" alt="Licenses"></a>
1111
<a href="https://www.paypal.me/xuri"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate"></a>
1212
</p>
@@ -15,7 +15,7 @@
1515

1616
## Introduction
1717

18-
xgen 是 Go 语言编写的 XSD (XML Schema Definition) 工具基础库。使用本基础库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [go.dev](https://pkg.go.dev/github.com/xuri/xgen?tab=doc)
18+
xgen 是 Go 语言编写的 XSD (XML Schema Definition) 工具基础库。使用本基础库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [go.dev](https://pkg.go.dev/github.com/xuri/xgen)
1919

2020
`xgen` 命令可将 XML 模式定义文件编译为多语言类型或类声明的代码。
2121

@@ -24,13 +24,13 @@ xgen 是 Go 语言编写的 XSD (XML Schema Definition) 工具基础库。使用
2424
如果您使用的是 Go 1.17 及更高版本,请使用 `go install` 安装可执行文件
2525

2626
```sh
27-
去安装 github.com/xuri/xgen/cmd/xgen@latest
27+
go install github.com/xuri/xgen/cmd/xgen@latest
2828
```
2929

3030
如果您使用的是 Go 1.16 及更早版本,请使用 `go get` 安装可执行文件
3131

3232
```sh
33-
去获取-u -v github.com/xuri/xgen/cmd/...
33+
go get -u -v github.com/xuri/xgen/cmd/...
3434
```
3535

3636
下面的命令将遍历 `xsd` 目录中的 XML 模式定义文件,并在 `output` 目录中生成 Go 语言结构体声明代码。

genC.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

genGo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

genJava.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

genRust.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

genTypeScript.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

parser.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

parser_test.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//
@@ -10,13 +10,14 @@ package xgen
1010

1111
import (
1212
"fmt"
13-
"github.com/stretchr/testify/assert"
14-
"github.com/stretchr/testify/require"
1513
"io/ioutil"
1614
"os"
1715
"path/filepath"
1816
"strings"
1917
"testing"
18+
19+
"github.com/stretchr/testify/assert"
20+
"github.com/stretchr/testify/require"
2021
)
2122

2223
var (
@@ -38,9 +39,11 @@ func TestParseGoExternal(t *testing.T) {
3839

3940
// testParseForSource runs parsing tests for a given language. The sourceDirectory specifies the root of the
4041
// input for the tests. The expected structure of the sourceDirectory is as follows:
41-
// source
42-
// ├── xsd (with the input xsd files to run through the parser)
43-
// └── <langDirName> (with the expected generated code named <xsd-file>.<fileExt>
42+
//
43+
// source
44+
// ├── xsd (with the input xsd files to run through the parser)
45+
// └── <langDirName> (with the expected generated code named <xsd-file>.<fileExt>
46+
//
4447
// The test cleans up files it generates unless leaveOutput is set to true. In which case, the generate file is left
4548
// on disk for manual inspection under <sourceDirectory>/<langDirName>/output.
4649
func testParseForSource(t *testing.T, lang string, fileExt string, langDirName string, sourceDirectory string, leaveOutput bool) {

proto.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//
@@ -102,9 +102,9 @@ type Group struct {
102102
// define if the elements it contains should be plural or not (as defined by the maxOccurs).
103103
// https://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition_details
104104
type Choice struct {
105-
ID string
106-
Choice []Choice
107-
Plural bool
105+
ID string
106+
Choice []Choice
107+
Plural bool
108108
}
109109

110110
// AttributeGroup definitions do not participate in ·validation· as such, but

schema.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

stack.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlAttribute.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlAttributeGroup.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlCharData.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlComplexType.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlElement.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlEnumeration.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlFractionDigits.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlGroup.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlImport.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlInclude.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlLength.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlList.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlMaxExclusive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlMaxInclusive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlMaxLength.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlMinExclusive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlMinInclusive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlMinLength.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlPattern.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlRestriction.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlSchema.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlSimpleType.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlTotalDigits.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlUnion.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

xmlWhiteSpace.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2021 The xgen Authors. All rights reserved. Use of this
1+
// Copyright 2020 - 2024 The xgen Authors. All rights reserved. Use of this
22
// source code is governed by a BSD-style license that can be found in the
33
// LICENSE file.
44
//

0 commit comments

Comments
 (0)