Skip to content

Commit 66136ad

Browse files
authored
Merge pull request #60 from paralin/shim-js
fix: add shim for js
2 parents 8d3c090 + 7363311 commit 66136ad

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

console.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ import (
2222
"os"
2323
)
2424

25-
var ErrNotAConsole = errors.New("provided file is not a console")
25+
var (
26+
ErrNotAConsole = errors.New("provided file is not a console")
27+
ErrNotImplemented = errors.New("not implemented")
28+
)
2629

2730
type File interface {
2831
io.ReadWriteCloser

console_other.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//go:build !darwin && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos
2+
// +build !darwin,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
3+
4+
/*
5+
Copyright The containerd Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
*/
19+
20+
package console
21+
22+
// NewPty creates a new pty pair
23+
// The master is returned as the first console and a string
24+
// with the path to the pty slave is returned as the second
25+
func NewPty() (Console, string, error) {
26+
return nil, "", ErrNotImplemented
27+
}
28+
29+
// checkConsole checks if the provided file is a console
30+
func checkConsole(f File) error {
31+
return ErrNotAConsole
32+
}
33+
34+
func newMaster(f File) (Console, error) {
35+
return nil, ErrNotImplemented
36+
}

console_windows.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ import (
2424
"golang.org/x/sys/windows"
2525
)
2626

27-
var (
28-
vtInputSupported bool
29-
ErrNotImplemented = errors.New("not implemented")
30-
)
27+
var vtInputSupported bool
3128

3229
func (m *master) initStdios() {
3330
// Note: We discard console mode warnings, because in/out can be redirected.

0 commit comments

Comments
 (0)