Closed
Conversation
*: initial fork updates
encode: escape non-ASCII characters while marshalling
tables: escape apostrophe as well for C# compatibility
Ref. nspcc-dev/neo-go#3224. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
*: escape HTML chars into uppercase unicode bytes
No linting for this project, sorry. We'd better avoid merge conflicts from the base repository. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
We're interested in the most fresh NeoGo-compatible versions. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
.github: take care of testing jobs
Ref nspcc-dev/neo-go#3284. Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
tables: escape double quotes for C# compatibility
This makes encoding follow .NET JSON/UTF8 libraries as much as possible,
tested with
using System;
using System.IO;
using System.Text.Json;
public class Program
{
public static void Main()
{
string controls = "\x00\x01";
MemoryStream ms = new MemoryStream();
Utf8JsonWriter writer = new Utf8JsonWriter(ms, new JsonWriterOptions
{
SkipValidation = true,
});
writer.WriteStringValue(controls);
writer.Flush();
byte[] res = ms.ToArray();
string result = System.Text.Encoding.UTF8.GetString(res);
Console.WriteLine(result);
}
}
which is similar to what Neo does. Can't comment on differences much because
that's just the way .NET is, it doesn't use \ufffd, it escapes some controls in
a different way, it just does what it wants and we have to follow here to be
compatible.
Notice that C# `\x` escaping differs from Go significantly if you want to play
with it (it's `\xH[H][H][H]` instead of `\xHH`). It also interprets bytes a bit
differently.
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Seems like they're so old they can't be executed. Drop useless actions at the same time. Signed-off-by: Roman Khimov <roman@nspcc.ru>
Fix dotnet compatibility
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
It's available since Go 1.9. Signed-off-by: Roman Khimov <roman@nspcc.ru>
We don't need virtuald variant here. Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Hi, Go 1.18. Signed-off-by: Roman Khimov <roman@nspcc.ru>
encode.go:743:12 errcheck Error return value of `enc.Write` is not checked It's not very likely (bytes.ErrTooLarge maybe), but this code runs inside a defer/recover, so we can handle it this way. Signed-off-by: Roman Khimov <roman@nspcc.ru>
And use 1.23 for tests now. Fixes #10. Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
level=warning msg="The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar." Signed-off-by: Roman Khimov <roman@nspcc.ru>
Error: SA1019: reflect.PtrTo has been deprecated since Go 1.22 and an alternative has been available since Go 1.18: Superseded by [PointerTo]. (staticcheck) These methods are exactly the same. Signed-off-by: Roman Khimov <roman@nspcc.ru>
No Makefile here, so just a GH update. Signed-off-by: Roman Khimov <roman@nspcc.ru>
workflows: switch to org-wide linter
Support for macos-12 will be deprecated 10/7/24 and the image will be fully unsupported by 12/3/24. Ref. actions/runner-images#10721. Get rid of the build warning: ``` A brownout will take place on November 4, 14:00 UTC - November 5, 00:00 UTC to raise awareness of the upcoming macOS-12 environment removal. ``` Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
workflows: drop macos-12 runner support
Signed-off-by: Roman Khimov <roman@nspcc.ru>
v2 is obsolete and no longer supported. Signed-off-by: Roman Khimov <roman@nspcc.ru>
1.22 is obsolete. Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Use fmt.Fprintf(...) instead of WriteString(fmt.Sprintf(...)). Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Could remove embedded field from selector. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Follow https://github.com/nspcc-dev/.github/blob/6c4dff04862ad947805e82fb9b664899906c6305/gh.md. Signed-off-by: Roman Khimov <roman@nspcc.ru>
Follow https://github.com/nspcc-dev/.github/blob/6c4dff04862ad947805e82fb9b664899906c6305/gh.md. Signed-off-by: Roman Khimov <roman@nspcc.ru>
Update runners
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
These things are done on purpose. Signed-off-by: Roman Khimov <roman@nspcc.ru>
Use https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/modernize to improve our code. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref. nspcc-dev/.github#45.