You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sink_socket_test.go
    path of file: ./repos/vault/internal/observability/event
    
    the code of the file until where you have to start completion: // Copyright (c) HashiCorp, Inc.
// SPDX-License-Iden
    
func TestNewSocketSink(t *testing.T) {
	t.Parallel()

	tests := map[string]struct {
		address        string
		format         string
		opts           []Option
		want           *SocketSink
		wantErr        bool
		expectedErrMsg string
	}{
		"address-empty": {
			address:        "",
			wantErr:        true,
			expectedErrMsg: "event.NewSocketSink: address is required: invalid parameter",
		},
		"address-whitespace": {
			address:        "    ",
			wantErr:        true,
			expectedErrMsg: "event.NewSocketSink: address is required: invalid parameter",
		},
		"format-empty": {
			address:        "addr",
			format:         "",
			wantErr:        true,
			expectedErrMsg: "event.NewSocketSink: format is required: invalid parameter",
		},
		"format-whitespace": {
			address:        "addr",
			format:         "   ",
			wantErr:        true,
			expectedErrMsg: "event.NewSocketSink: format is required: invalid parameter",
		},
		"bad-max-duration": {
			address:        "addr",
			format:         "json",
			opts:           []Option{WithMaxDuration("bar")},
			wantErr:        true,
			expectedErrMsg: "event.NewSocketSink: error applying options: unable to parse max duration: time: invalid duration \"bar\"",
		},
		"happy": {
			address: "wss://foo",
			format:  "json",
			want: &SocketSink{
				requiredFormat: "json",
				address:        "wss://foo",
				socketType:     "tcp",           // defaults to tcp
				maxDuration:    2 * time.Second, // defaults to 2 secs
			},
		},
	}

	for name, tc := range tests {
		name := name
		tc := tc
		t.Run(name, func(t *testing.T) {
			t.Parallel()

			got, err := NewSocketSink(tc.address, tc.format, tc.opts...)

			if tc.wantErr {
				require.Error(t, err)
				require.EqualError(t, err, tc.expectedErrMsg)
				require.Nil(t, got)
			} else {
				require.NoError(t, err)
				require.Equal(t, tc.want, got)
			}
		})
	}
}