Compare commits
96 Commits
Author | SHA1 | Date | |
---|---|---|---|
31b7e7182e | |||
560c8d9704 | |||
a1f8ab7806 | |||
adb3922a87 | |||
1da599be18 | |||
|
bd1d927425 | ||
0c15424744 | |||
|
e9fa24abef | ||
b1658acca3 | |||
|
693f3413c4 | ||
5dd6941054 | |||
|
2b426a632e | ||
97bc0c0cc4 | |||
|
b62f883443 | ||
ce1fc938ce | |||
|
bb765e86f5 | ||
cce2e66410 | |||
|
8c53df737e | ||
|
19e8e150d4 | ||
|
314c43d3da | ||
5682e07e33 | |||
|
f740ec3fc9 | ||
9f5c40bd81 | |||
|
587c6f334e | ||
6a8ceba0e3 | |||
|
b314a884ba | ||
97093818cb | |||
|
54385a6d5b | ||
17adf36537 | |||
|
2c8c75b01f | ||
|
6ec4729e61 | ||
afa46fac82 | |||
|
12fb590a3d | ||
|
98a18053e1 | ||
3272039e80 | |||
|
76cdb0e86e | ||
ab5902c009 | |||
|
ab9c8da1b1 | ||
|
1466ea03aa | ||
|
999be6d821 | ||
|
1c663f81bc | ||
|
93d8dbae1d | ||
ac01124d8f | |||
|
4f31d16092 | ||
7975b61bb4 | |||
|
199042a8c2 | ||
|
db0bb2408d | ||
ea263b0337 | |||
|
a6c2e49e30 | ||
|
2ba5a48137 | ||
|
1a101d1b22 | ||
112ae7ed38 | |||
|
e8dac419f6 | ||
8b3029a910 | |||
|
90c5362cc1 | ||
5867a12049 | |||
|
15df8eb771 | ||
4f69a911c7 | |||
|
67fbc8af2c | ||
e8f1805a73 | |||
|
1f11aac0a6 | ||
729b62480e | |||
|
6a6d045f6d | ||
0a6205e982 | |||
|
4c57758283 | ||
7f216b6060 | |||
fec92bbbe7 | |||
4aca7e9d64 | |||
|
fda3d7ba77 | ||
9bcdabc35a | |||
|
d3f220643e | ||
cbbbd8bfa8 | |||
|
f2ee146d2c | ||
42eca6aa24 | |||
|
184d264c48 | ||
9e538f587b | |||
|
2c0c88d6ac | ||
cd12f33bd4 | |||
|
a2f232532f | ||
28412e67c5 | |||
|
113a92656a | ||
7b3c60af04 | |||
|
e46d5d60d4 | ||
e73cb3d98f | |||
|
81e6fc3351 | ||
f99f861d5a | |||
6a133b6191 | |||
|
057c01565b | ||
37d1caca89 | |||
|
5d7aa1cba1 | ||
a214d7aebb | |||
|
c7239fc6fb | ||
f778707dbd | |||
|
cdf89a1446 | ||
3397fbf3b3 | |||
f350043faf |
20
.github/workflows/autoapprove.yml
vendored
Normal file
20
.github/workflows/autoapprove.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
name: "autoapprove"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [assigned, opened, synchronize, reopened]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
autoapprove:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: approve
|
||||||
|
uses: hmarr/auto-approve-action@v3
|
||||||
|
if: github.actor == 'vtolstov' || github.actor == 'dependabot[bot]'
|
||||||
|
id: approve
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
21
.github/workflows/automerge.yml
vendored
Normal file
21
.github/workflows/automerge.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
name: "automerge"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [assigned, opened, synchronize, reopened]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
automerge:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.actor == 'vtolstov'
|
||||||
|
steps:
|
||||||
|
- name: merge
|
||||||
|
id: merge
|
||||||
|
run: gh pr merge --auto --merge "$PR_URL"
|
||||||
|
env:
|
||||||
|
PR_URL: ${{github.event.pull_request.html_url}}
|
||||||
|
GITHUB_TOKEN: ${{secrets.TOKEN}}
|
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@ -3,19 +3,20 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- v3
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: test
|
name: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: setup
|
- name: setup
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.16
|
go-version: 1.17
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: cache
|
- name: cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/go/pkg/mod
|
path: ~/go/pkg/mod
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
@ -31,9 +32,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: lint
|
- name: lint
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v3.4.0
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
||||||
|
29
.github/workflows/codeql-analysis.yml
vendored
29
.github/workflows/codeql-analysis.yml
vendored
@ -9,7 +9,7 @@
|
|||||||
# the `language` matrix defined below to confirm you have the correct set of
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
# supported CodeQL languages.
|
# supported CodeQL languages.
|
||||||
#
|
#
|
||||||
name: "CodeQL"
|
name: "codeql"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
@ -17,16 +17,16 @@ on:
|
|||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master, v3 ]
|
||||||
pull_request:
|
pull_request:
|
||||||
# The branches below must be a subset of the branches above
|
# The branches below must be a subset of the branches above
|
||||||
branches: [ master ]
|
branches: [ master, v3 ]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '34 1 * * 0'
|
- cron: '34 1 * * 0'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
name: Analyze
|
name: analyze
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
@ -42,12 +42,15 @@ jobs:
|
|||||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
- name: setup
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: 1.17
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: init
|
||||||
uses: github/codeql-action/init@v1
|
uses: github/codeql-action/init@v2
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
@ -57,8 +60,8 @@ jobs:
|
|||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: autobuild
|
||||||
uses: github/codeql-action/autobuild@v1
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
@ -71,5 +74,5 @@ jobs:
|
|||||||
# make bootstrap
|
# make bootstrap
|
||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: analyze
|
||||||
uses: github/codeql-action/analyze@v1
|
uses: github/codeql-action/analyze@v2
|
||||||
|
73
.github/workflows/dependabot-automerge.yml
vendored
73
.github/workflows/dependabot-automerge.yml
vendored
@ -1,66 +1,27 @@
|
|||||||
name: "prautomerge"
|
name: "dependabot-automerge"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
pull_request_target:
|
||||||
workflows: ["prbuild"]
|
types: [assigned, opened, synchronize, reopened]
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Dependabot-Automerge:
|
automerge:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Contains workaround to execute if dependabot updates the PR by checking for the base branch in the linked PR
|
if: github.actor == 'dependabot[bot]'
|
||||||
# The the github.event.workflow_run.event value is 'push' and not 'pull_request'
|
|
||||||
# dont work with multiple workflows when last returns success
|
|
||||||
if: >-
|
|
||||||
github.event.workflow_run.conclusion == 'success'
|
|
||||||
&& github.actor == 'dependabot[bot]'
|
|
||||||
&& github.event.sender.login == 'dependabot[bot]'
|
|
||||||
&& github.event.sender.type == 'Bot'
|
|
||||||
&& (github.event.workflow_run.event == 'pull_request'
|
|
||||||
|| (github.event.workflow_run.event == 'push' && github.event.workflow_run.pull_requests[0].base.ref == github.event.repository.default_branch ))
|
|
||||||
steps:
|
steps:
|
||||||
- name: Approve Changes and Merge changes if label 'dependencies' is set
|
- name: metadata
|
||||||
uses: actions/github-script@v5
|
id: metadata
|
||||||
|
uses: dependabot/fetch-metadata@v1.3.6
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: "${{ secrets.TOKEN }}"
|
||||||
script: |
|
- name: merge
|
||||||
console.log(context.payload.workflow_run);
|
id: merge
|
||||||
|
if: ${{contains(steps.metadata.outputs.dependency-names, 'go.unistack.org')}}
|
||||||
var labelNames = await github.paginate(
|
run: gh pr merge --auto --merge "$PR_URL"
|
||||||
github.issues.listLabelsOnIssue,
|
env:
|
||||||
{
|
PR_URL: ${{github.event.pull_request.html_url}}
|
||||||
repo: context.repo.repo,
|
GITHUB_TOKEN: ${{secrets.TOKEN}}
|
||||||
owner: context.repo.owner,
|
|
||||||
issue_number: context.payload.workflow_run.pull_requests[0].number,
|
|
||||||
},
|
|
||||||
(response) => response.data.map(
|
|
||||||
(label) => label.name
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(labelNames);
|
|
||||||
|
|
||||||
if (labelNames.includes('dependencies')) {
|
|
||||||
console.log('Found label');
|
|
||||||
|
|
||||||
await github.pulls.createReview({
|
|
||||||
repo: context.repo.repo,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
pull_number: context.payload.workflow_run.pull_requests[0].number,
|
|
||||||
event: 'APPROVE'
|
|
||||||
});
|
|
||||||
console.log('Approved PR');
|
|
||||||
|
|
||||||
await github.pulls.merge({
|
|
||||||
repo: context.repo.repo,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
pull_number: context.payload.workflow_run.pull_requests[0].number,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('Merged PR');
|
|
||||||
}
|
|
||||||
|
13
.github/workflows/pr.yml
vendored
13
.github/workflows/pr.yml
vendored
@ -3,19 +3,20 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- v3
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: test
|
name: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: setup
|
- name: setup
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.16
|
go-version: 1.17
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: cache
|
- name: cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/go/pkg/mod
|
path: ~/go/pkg/mod
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
@ -31,9 +32,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: lint
|
- name: lint
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v3.4.0
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
||||||
|
@ -28,7 +28,7 @@ func TestFrameFlatten(t *testing.T) {
|
|||||||
Name: &codec.Frame{Data: []byte("test")},
|
Name: &codec.Frame{Data: []byte("test")},
|
||||||
}
|
}
|
||||||
|
|
||||||
buf, err := NewCodec().Marshal(s)
|
buf, err := NewCodec(codec.Flatten(true)).Marshal(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -37,14 +37,18 @@ func TestFrameFlatten(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestReadBody(t *testing.T) {
|
func TestNativeYamlTags(t *testing.T) {
|
||||||
s := &struct {
|
s := &struct {
|
||||||
Name string
|
One string `yaml:"first"`
|
||||||
}{}
|
}{
|
||||||
c := NewCodec()
|
One: "",
|
||||||
b := bytes.NewReader(nil)
|
}
|
||||||
err := c.ReadBody(b, s)
|
|
||||||
|
err := NewCodec().Unmarshal([]byte(`first: "val"`), s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
if s.One != "val" {
|
||||||
|
t.Fatalf("XXX %#+v\n", s)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
7
go.mod
7
go.mod
@ -3,7 +3,8 @@ module go.unistack.org/micro-codec-yaml/v3
|
|||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/ghodss/yaml v1.0.0
|
go.unistack.org/micro-proto/v3 v3.4.1
|
||||||
go.unistack.org/micro/v3 v3.8.4
|
go.unistack.org/micro/v3 v3.10.94
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
google.golang.org/protobuf v1.34.2 // indirect
|
||||||
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
)
|
)
|
||||||
|
70
yaml.go
70
yaml.go
@ -1,12 +1,11 @@
|
|||||||
// Package yaml provides a yaml codec
|
// Package yaml provides a yaml codec
|
||||||
package yaml
|
package yaml // import "go.unistack.org/micro-codec-yaml/v3"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
pb "go.unistack.org/micro-proto/v3/codec"
|
||||||
|
|
||||||
"github.com/ghodss/yaml"
|
|
||||||
"go.unistack.org/micro/v3/codec"
|
"go.unistack.org/micro/v3/codec"
|
||||||
rutil "go.unistack.org/micro/v3/util/reflect"
|
rutil "go.unistack.org/micro/v3/util/reflect"
|
||||||
|
yaml "gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
type yamlCodec struct {
|
type yamlCodec struct {
|
||||||
@ -15,10 +14,6 @@ type yamlCodec struct {
|
|||||||
|
|
||||||
var _ codec.Codec = &yamlCodec{}
|
var _ codec.Codec = &yamlCodec{}
|
||||||
|
|
||||||
const (
|
|
||||||
flattenTag = "flatten"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (c *yamlCodec) Marshal(v interface{}, opts ...codec.Option) ([]byte, error) {
|
func (c *yamlCodec) Marshal(v interface{}, opts ...codec.Option) ([]byte, error) {
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
@ -28,11 +23,17 @@ func (c *yamlCodec) Marshal(v interface{}, opts ...codec.Option) ([]byte, error)
|
|||||||
for _, o := range opts {
|
for _, o := range opts {
|
||||||
o(&options)
|
o(&options)
|
||||||
}
|
}
|
||||||
if nv, nerr := rutil.StructFieldByTag(v, options.TagName, flattenTag); nerr == nil {
|
|
||||||
v = nv
|
if options.Flatten {
|
||||||
|
if nv, nerr := rutil.StructFieldByTag(v, options.TagName, "flatten"); nerr == nil {
|
||||||
|
v = nv
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if m, ok := v.(*codec.Frame); ok {
|
switch m := v.(type) {
|
||||||
|
case *codec.Frame:
|
||||||
|
return m.Data, nil
|
||||||
|
case *pb.Frame:
|
||||||
return m.Data, nil
|
return m.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,11 +50,17 @@ func (c *yamlCodec) Unmarshal(b []byte, v interface{}, opts ...codec.Option) err
|
|||||||
o(&options)
|
o(&options)
|
||||||
}
|
}
|
||||||
|
|
||||||
if nv, nerr := rutil.StructFieldByTag(v, options.TagName, flattenTag); nerr == nil {
|
if options.Flatten {
|
||||||
v = nv
|
if nv, nerr := rutil.StructFieldByTag(v, options.TagName, "flatten"); nerr == nil {
|
||||||
|
v = nv
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if m, ok := v.(*codec.Frame); ok {
|
switch m := v.(type) {
|
||||||
|
case *codec.Frame:
|
||||||
|
m.Data = b
|
||||||
|
return nil
|
||||||
|
case *pb.Frame:
|
||||||
m.Data = b
|
m.Data = b
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -61,41 +68,6 @@ func (c *yamlCodec) Unmarshal(b []byte, v interface{}, opts ...codec.Option) err
|
|||||||
return yaml.Unmarshal(b, v)
|
return yaml.Unmarshal(b, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *yamlCodec) ReadHeader(conn io.Reader, m *codec.Message, t codec.MessageType) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *yamlCodec) ReadBody(conn io.Reader, v interface{}) error {
|
|
||||||
if v == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
buf, err := io.ReadAll(conn)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
} else if len(buf) == 0 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.Unmarshal(buf, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *yamlCodec) Write(conn io.Writer, m *codec.Message, v interface{}) error {
|
|
||||||
if v == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
buf, err := c.Marshal(v)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
} else if len(buf) == 0 {
|
|
||||||
return codec.ErrInvalidMessage
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = conn.Write(buf)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *yamlCodec) String() string {
|
func (c *yamlCodec) String() string {
|
||||||
return "yaml"
|
return "yaml"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user