string_array.go

package app

import (
    "strings"
)

type StringArray []string

func (a *StringArray) Set(s string) error {
    *a = append(*a, s)
    return nil
}

func (a *StringArray) String() string {
    return strings.Join(*a, ",")
}

上一篇:另类AOP设计


下一篇:LeetCode Reverse Linked List (反置链表)