Skip to content

Commit

Permalink
Fix incorrect README install command and update dependencies (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyimingdatiancai authored Jul 22, 2024
1 parent 61e2702 commit d0691b7
Show file tree
Hide file tree
Showing 39 changed files with 57 additions and 54 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<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>
<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>
<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>
<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>
<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>
<a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/license-bsd-orange.svg" alt="Licenses"></a>
<a href="https://www.paypal.me/xuri"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate"></a>
</p>
Expand All @@ -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.

Expand Down
8 changes: 4 additions & 4 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<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>
<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>
<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>
<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>
<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>
<a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/license-bsd-orange.svg" alt="Licenses"></a>
<a href="https://www.paypal.me/xuri"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate"></a>
</p>
Expand All @@ -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 模式定义文件编译为多语言类型或类声明的代码。

Expand All @@ -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 语言结构体声明代码。
Expand Down
2 changes: 1 addition & 1 deletion genC.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion genGo.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion genJava.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion genRust.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion genTypeScript.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion parser.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
15 changes: 9 additions & 6 deletions parser_test.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand All @@ -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 (
Expand All @@ -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)
// └── <langDirName> (with the expected generated code named <xsd-file>.<fileExt>
//
// source
// ├── xsd (with the input xsd files to run through the parser)
// └── <langDirName> (with the expected generated code named <xsd-file>.<fileExt>
//
// 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 <sourceDirectory>/<langDirName>/output.
func testParseForSource(t *testing.T, lang string, fileExt string, langDirName string, sourceDirectory string, leaveOutput bool) {
Expand Down
8 changes: 4 additions & 4 deletions proto.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion schema.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion stack.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlAttribute.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlAttributeGroup.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlCharData.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlComplexType.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlElement.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlEnumeration.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlFractionDigits.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlGroup.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlImport.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlInclude.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlLength.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlList.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlMaxExclusive.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlMaxInclusive.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlMaxLength.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlMinExclusive.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlMinInclusive.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlMinLength.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlPattern.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlRestriction.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlSchema.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlSimpleType.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlTotalDigits.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlUnion.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion xmlWhiteSpace.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down

0 comments on commit d0691b7

Please sign in to comment.