Skip to content

Commit

Permalink
channel: Remove the Varint framing.
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed May 10, 2021
1 parent cc566c1 commit 70cc886
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 72 deletions.
1 change: 0 additions & 1 deletion channel/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func BenchmarkFramingCost(b *testing.B) {
{"LSP", channel.LSP},
{"NUL", channel.Split('\x00')},
{"RawJSON", channel.RawJSON},
{"Varint", channel.Varint},
}

msg, err := json.Marshal(benchMessage)
Expand Down
1 change: 0 additions & 1 deletion channel/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ var tests = []struct {
{"RS", Split('\x1e')},
{"RawJSON", RawJSON},
{"StrictHeader", StrictHeader("text/plain")},
{"Varint", Varint},
}

// N.B. the messages in this list must be valid JSON, since the RawJSON framing
Expand Down
8 changes: 3 additions & 5 deletions channel/chanutil/chanutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
// line -- corresponds to channel.Line
// lsp -- corresponds to channel.LSP
// raw -- corresponds to channel.RawJSON
// varint -- corresponds to channel.Varint
//
func Framing(name string) channel.Framing {
if t := strings.TrimPrefix(name, "header:"); t != name {
Expand All @@ -29,8 +28,7 @@ func Framing(name string) channel.Framing {
}

var framings = map[string]channel.Framing{
"line": channel.Line,
"lsp": channel.LSP,
"raw": channel.RawJSON,
"varint": channel.Varint,
"line": channel.Line,
"lsp": channel.LSP,
"raw": channel.RawJSON,
}
64 changes: 0 additions & 64 deletions channel/varint.go

This file was deleted.

2 changes: 1 addition & 1 deletion server/loop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/creachadair/jrpc2/handler"
)

var newChan = channel.Varint
var newChan = channel.Line

// A static test service that returns the same thing each time.
var testService = NewStatic(handler.Map{
Expand Down

0 comments on commit 70cc886

Please sign in to comment.