Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update spec091.go #224

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions gen.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$DebugPreference = 'Continue'
$ErrorActionPreference = 'Stop'

Set-PSDebug -Off
Set-StrictMode -Version 'Latest' -ErrorAction 'Stop' -Verbose

New-Variable -Name curdir -Option Constant -Value $PSScriptRoot

$specDir = Resolve-Path -LiteralPath (Join-Path -Path $curdir -ChildPath 'spec')
$amqpSpecXml = Resolve-Path -LiteralPath (Join-Path -Path $specDir -ChildPath 'amqp0-9-1.stripped.extended.xml')
$gen = Resolve-Path -LiteralPath (Join-Path -Path $specDir -ChildPath 'gen.go')
$spec091 = Resolve-Path -LiteralPath (Join-Path -Path $curdir -ChildPath 'spec091.go')

Get-Content -LiteralPath $amqpSpecXml | go run $gen | gofmt | Set-Content -Force -Path $spec091
27 changes: 14 additions & 13 deletions spec/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ import (
"fmt"
"io"
"log"
"os"
"regexp"
"strings"
"text/template"
)

var (
ErrUnknownType = errors.New("Unknown field type in gen")
ErrUnknownDomain = errors.New("Unknown domain type in gen")
ErrUnknownType = errors.New("unknown field type in gen")
ErrUnknownDomain = errors.New("unknown domain type in gen")
)

var amqpTypeToNative = map[string]string{
Expand Down Expand Up @@ -147,17 +148,17 @@ var (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

/* GENERATED FILE - DO NOT EDIT */
/* Rebuild from the spec/gen.go tool */
/* GENERATED FILE - DO NOT EDIT */
/* Rebuild from the spec/gen.go tool */

{{with .Root}}
package amqp091
{{with .Root}}
package amqp091

import (
"fmt"
"encoding/binary"
"io"
)
import (
"fmt"
"encoding/binary"
"io"
)

// Error codes that can be sent from the server during a connection or
// channel exception or used by the client to indicate a class of error like
Expand Down Expand Up @@ -241,7 +242,7 @@ var (
switch mf.MethodId {
{{range .Methods}}
case {{.Index}}: // {{$class.Name}} {{.Name}}
//fmt.Println("NextMethod: class:{{$class.Index}} method:{{.Index}}")
// fmt.Println("NextMethod: class:{{$class.Index}} method:{{.Index}}")
method := &{{$.StructName $class.Name .Name}}{}
if err = method.read(r.r); err != nil {
return
Expand Down Expand Up @@ -434,7 +435,7 @@ func (renderer *renderer) Domain(field Field) (domain Domain, err error) {
}
}
return domain, nil
//return domain, ErrUnknownDomain
// return domain, ErrUnknownDomain
}

func (renderer *renderer) FieldName(field Field) (t string) {
Expand Down
Loading