1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

code cleanup

This commit is contained in:
V2Ray 2015-09-20 13:08:05 +02:00
parent ad613a9e3e
commit 5d5102de4c
8 changed files with 29 additions and 29 deletions

View File

@ -44,5 +44,5 @@ func TestServerSampleConfig(t *testing.T) {
assert.Int(len(config.InboundConfig().Content())).GreaterThan(0) assert.Int(len(config.InboundConfig().Content())).GreaterThan(0)
assert.String(config.OutboundConfig().Protocol()).Equals("freedom") assert.String(config.OutboundConfig().Protocol()).Equals("freedom")
assert.Int(len(config.OutboundConfig().Content())).Equals(0) assert.Int(len(config.OutboundConfig().Content())).Equals(0)
} }

View File

@ -11,10 +11,10 @@ type BytesSubject struct {
} }
func NewBytesSubject(base *Subject, value []byte) *BytesSubject { func NewBytesSubject(base *Subject, value []byte) *BytesSubject {
subject := new(BytesSubject) return &BytesSubject{
subject.Subject = base Subject: base,
subject.value = value value: value,
return subject }
} }
func (subject *BytesSubject) Named(name string) *BytesSubject { func (subject *BytesSubject) Named(name string) *BytesSubject {

View File

@ -10,10 +10,10 @@ type ByteSubject struct {
} }
func NewByteSubject(base *Subject, value byte) *ByteSubject { func NewByteSubject(base *Subject, value byte) *ByteSubject {
subject := new(ByteSubject) return &ByteSubject{
subject.Subject = base Subject: base,
subject.value = value value: value,
return subject }
} }
func (subject *ByteSubject) Named(name string) *ByteSubject { func (subject *ByteSubject) Named(name string) *ByteSubject {

View File

@ -6,10 +6,10 @@ type ErrorSubject struct {
} }
func NewErrorSubject(base *Subject, value error) *ErrorSubject { func NewErrorSubject(base *Subject, value error) *ErrorSubject {
subject := new(ErrorSubject) return &ErrorSubject{
subject.Subject = base Subject: base,
subject.value = value value: value,
return subject }
} }
func (subject *ErrorSubject) Named(name string) *ErrorSubject { func (subject *ErrorSubject) Named(name string) *ErrorSubject {

View File

@ -10,10 +10,10 @@ type IntSubject struct {
} }
func NewIntSubject(base *Subject, value int) *IntSubject { func NewIntSubject(base *Subject, value int) *IntSubject {
subject := new(IntSubject) return &IntSubject{
subject.Subject = base Subject: base,
subject.value = value value: value,
return subject }
} }
func (subject *IntSubject) Named(name string) *IntSubject { func (subject *IntSubject) Named(name string) *IntSubject {

View File

@ -6,10 +6,10 @@ type StringSubject struct {
} }
func NewStringSubject(base *Subject, value string) *StringSubject { func NewStringSubject(base *Subject, value string) *StringSubject {
subject := new(StringSubject) return &StringSubject{
subject.Subject = base Subject: base,
subject.value = value value: value,
return subject }
} }
func (subject *StringSubject) Named(name string) *StringSubject { func (subject *StringSubject) Named(name string) *StringSubject {

View File

@ -6,10 +6,10 @@ type Subject struct {
} }
func NewSubject(assert *Assertion) *Subject { func NewSubject(assert *Assertion) *Subject {
subject := new(Subject) return &Subject{
subject.assert = assert assert: assert,
subject.name = "" name: "",
return subject }
} }
func (subject *Subject) FailWithMessage(message string) { func (subject *Subject) FailWithMessage(message string) {

View File

@ -10,10 +10,10 @@ type Uint16Subject struct {
} }
func NewUint16Subject(base *Subject, value uint16) *Uint16Subject { func NewUint16Subject(base *Subject, value uint16) *Uint16Subject {
subject := new(Uint16Subject) return &Uint16Subject{
subject.Subject = base Subject: base,
subject.value = value value: value,
return subject }
} }
func (subject *Uint16Subject) Named(name string) *Uint16Subject { func (subject *Uint16Subject) Named(name string) *Uint16Subject {