Skip to content

Commit 072e5bb

Browse files
committed
Make lint
1 parent c73c7d9 commit 072e5bb

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

components/camera/camera.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ type NamedImage struct {
8181
mimeType string
8282
}
8383

84-
func NamedImageFromBytes(data []byte, sourceName string, mimeType string) (NamedImage, error) {
84+
// NamedImageFromBytes constructs a NamedImage from a byte slice, source name, and mime type.
85+
func NamedImageFromBytes(data []byte, sourceName, mimeType string) (NamedImage, error) {
8586
if data == nil {
8687
return NamedImage{}, fmt.Errorf("must provide image bytes to construct a named image from bytes")
8788
}
@@ -91,7 +92,8 @@ func NamedImageFromBytes(data []byte, sourceName string, mimeType string) (Named
9192
return NamedImage{data: data, SourceName: sourceName, mimeType: mimeType}, nil
9293
}
9394

94-
func NamedImageFromImage(img image.Image, sourceName string, mimeType string) (NamedImage, error) {
95+
// NamedImageFromImage constructs a NamedImage from an image.Image, source name, and mime type.
96+
func NamedImageFromImage(img image.Image, sourceName, mimeType string) (NamedImage, error) {
9597
if img == nil {
9698
return NamedImage{}, fmt.Errorf("must provide image to construct a named image")
9799
}
@@ -101,6 +103,7 @@ func NamedImageFromImage(img image.Image, sourceName string, mimeType string) (N
101103
return NamedImage{img: img, SourceName: sourceName, mimeType: mimeType}, nil
102104
}
103105

106+
// Image returns the image.Image of the NamedImage.
104107
func (ni *NamedImage) Image(ctx context.Context) (image.Image, error) {
105108
if ni.img == nil {
106109
if ni.data == nil {
@@ -115,6 +118,7 @@ func (ni *NamedImage) Image(ctx context.Context) (image.Image, error) {
115118
return ni.img, nil
116119
}
117120

121+
// Bytes returns the byte slice of the NamedImage.
118122
func (ni *NamedImage) Bytes(ctx context.Context) ([]byte, error) {
119123
if ni.data == nil {
120124
if ni.img == nil {

components/camera/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ func TestMultiplexOverMultiHopRemoteConnection(t *testing.T) {
826826
test.That(t, cameraClient.(rtppassthrough.Source).Unsubscribe(mainCtx, sub.ID), test.ShouldBeNil)
827827
}
828828

829-
// nolint
829+
//nolint
830830
// NOTE: These tests fail when this condition occurs:
831831
//
832832
// logger.go:130: 2024-06-17T16:56:14.097-0400 DEBUG TestGrandRemoteRebooting.remote-1.rdk:remote:/remote-2.webrtc rpc/wrtc_client_channel.go:299 no stream for id; discarding {"ch": 0, "id": 11}

0 commit comments

Comments
 (0)