Skip to content

Commit b8d6fcc

Browse files
committedMay 5, 2023
Fix golangci-lint warnings
1 parent 476d624 commit b8d6fcc

File tree

3 files changed

+68
-57
lines changed

3 files changed

+68
-57
lines changed
 

‎jsep.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ func extMapURI() map[int]string {
5959
// some settings that are required by the JSEP spec.
6060
//
6161
// Note: Since v2.4.0, session ID has been fixed to use crypto random according to
62-
// JSEP spec, so that NewJSEPSessionDescription now returns error as a second
63-
// return value.
62+
//
63+
// JSEP spec, so that NewJSEPSessionDescription now returns error as a second
64+
// return value.
6465
func NewJSEPSessionDescription(identity bool) (*SessionDescription, error) {
6566
sid, err := newSessionID()
6667
if err != nil {
@@ -123,7 +124,7 @@ func (s *SessionDescription) WithMedia(md *MediaDescription) *SessionDescription
123124

124125
// NewJSEPMediaDescription creates a new MediaName with
125126
// some settings that are required by the JSEP spec.
126-
func NewJSEPMediaDescription(codecType string, codecPrefs []string) *MediaDescription {
127+
func NewJSEPMediaDescription(codecType string, _ []string) *MediaDescription {
127128
return &MediaDescription{
128129
MediaName: MediaName{
129130
Media: codecType,

‎marshal.go

+27-24
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,37 @@ import (
1010
// Marshal takes a SDP struct to text
1111
// https://tools.ietf.org/html/rfc4566#section-5
1212
// Session description
13-
// v= (protocol version)
14-
// o= (originator and session identifier)
15-
// s= (session name)
16-
// i=* (session information)
17-
// u=* (URI of description)
18-
// e=* (email address)
19-
// p=* (phone number)
20-
// c=* (connection information -- not required if included in
21-
// all media)
22-
// b=* (zero or more bandwidth information lines)
23-
// One or more time descriptions ("t=" and "r=" lines; see below)
24-
// z=* (time zone adjustments)
25-
// k=* (encryption key)
26-
// a=* (zero or more session attribute lines)
27-
// Zero or more media descriptions
13+
//
14+
// v= (protocol version)
15+
// o= (originator and session identifier)
16+
// s= (session name)
17+
// i=* (session information)
18+
// u=* (URI of description)
19+
// e=* (email address)
20+
// p=* (phone number)
21+
// c=* (connection information -- not required if included in
22+
// all media)
23+
// b=* (zero or more bandwidth information lines)
24+
// One or more time descriptions ("t=" and "r=" lines; see below)
25+
// z=* (time zone adjustments)
26+
// k=* (encryption key)
27+
// a=* (zero or more session attribute lines)
28+
// Zero or more media descriptions
2829
//
2930
// Time description
30-
// t= (time the session is active)
31-
// r=* (zero or more repeat times)
31+
//
32+
// t= (time the session is active)
33+
// r=* (zero or more repeat times)
3234
//
3335
// Media description, if present
34-
// m= (media name and transport address)
35-
// i=* (media title)
36-
// c=* (connection information -- optional if included at
37-
// session level)
38-
// b=* (zero or more bandwidth information lines)
39-
// k=* (encryption key)
40-
// a=* (zero or more media attribute lines)
36+
//
37+
// m= (media name and transport address)
38+
// i=* (media title)
39+
// c=* (connection information -- optional if included at
40+
// session level)
41+
// b=* (zero or more bandwidth information lines)
42+
// k=* (encryption key)
43+
// a=* (zero or more media attribute lines)
4144
func (s *SessionDescription) Marshal() ([]byte, error) {
4245
m := make(marshaller, 0, 1024)
4346

‎unmarshal.go

+37-30
Original file line numberDiff line numberDiff line change
@@ -25,48 +25,55 @@ var (
2525
// (namely s1, s2, s3, ...) for a parsing procedure that complies with the
2626
// specifications laid out by the rfc4566#section-5 as well as by JavaScript
2727
// Session Establishment Protocol draft. Links:
28-
// https://tools.ietf.org/html/rfc4566#section-5
29-
// https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24
28+
//
29+
// https://tools.ietf.org/html/rfc4566#section-5
30+
// https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24
3031
//
3132
// https://tools.ietf.org/html/rfc4566#section-5
3233
// Session description
33-
// v= (protocol version)
34-
// o= (originator and session identifier)
35-
// s= (session name)
36-
// i=* (session information)
37-
// u=* (URI of description)
38-
// e=* (email address)
39-
// p=* (phone number)
40-
// c=* (connection information -- not required if included in
41-
// all media)
42-
// b=* (zero or more bandwidth information lines)
43-
// One or more time descriptions ("t=" and "r=" lines; see below)
44-
// z=* (time zone adjustments)
45-
// k=* (encryption key)
46-
// a=* (zero or more session attribute lines)
47-
// Zero or more media descriptions
34+
//
35+
// v= (protocol version)
36+
// o= (originator and session identifier)
37+
// s= (session name)
38+
// i=* (session information)
39+
// u=* (URI of description)
40+
// e=* (email address)
41+
// p=* (phone number)
42+
// c=* (connection information -- not required if included in
43+
// all media)
44+
// b=* (zero or more bandwidth information lines)
45+
// One or more time descriptions ("t=" and "r=" lines; see below)
46+
// z=* (time zone adjustments)
47+
// k=* (encryption key)
48+
// a=* (zero or more session attribute lines)
49+
// Zero or more media descriptions
4850
//
4951
// Time description
50-
// t= (time the session is active)
51-
// r=* (zero or more repeat times)
52+
//
53+
// t= (time the session is active)
54+
// r=* (zero or more repeat times)
5255
//
5356
// Media description, if present
54-
// m= (media name and transport address)
55-
// i=* (media title)
56-
// c=* (connection information -- optional if included at
57-
// session level)
58-
// b=* (zero or more bandwidth information lines)
59-
// k=* (encryption key)
60-
// a=* (zero or more media attribute lines)
57+
//
58+
// m= (media name and transport address)
59+
// i=* (media title)
60+
// c=* (connection information -- optional if included at
61+
// session level)
62+
// b=* (zero or more bandwidth information lines)
63+
// k=* (encryption key)
64+
// a=* (zero or more media attribute lines)
6165
//
6266
// In order to generate the following state table and draw subsequent
6367
// deterministic finite-state automota ("DFA") the following regex was used to
6468
// derive the DFA:
65-
// vosi?u?e?p?c?b*(tr*)+z?k?a*(mi?c?b*k?a*)*
69+
//
70+
// vosi?u?e?p?c?b*(tr*)+z?k?a*(mi?c?b*k?a*)*
71+
//
6672
// possible place and state to exit:
67-
// ** * * * ** * * * *
68-
// 99 1 1 1 11 1 1 1 1
69-
// 3 1 1 26 5 5 4 4
73+
//
74+
// ** * * * ** * * * *
75+
// 99 1 1 1 11 1 1 1 1
76+
// 3 1 1 26 5 5 4 4
7077
//
7178
// Please pay close attention to the `k`, and `a` parsing states. In the table
7279
// below in order to distinguish between the states belonging to the media

0 commit comments

Comments
 (0)
Please sign in to comment.