1package interfaces 2 3type first interface { 4 common() //@mark(firCommon, "common"),refs("common", firCommon, xCommon, zCommon) 5 firstMethod() //@mark(firMethod, "firstMethod"),refs("firstMethod", firMethod, xfMethod, zfMethod) 6} 7 8type second interface { 9 common() //@mark(secCommon, "common"),refs("common", secCommon, yCommon, zCommon) 10 secondMethod() //@mark(secMethod, "secondMethod"),refs("secondMethod", secMethod, ysMethod, zsMethod) 11} 12 13type s struct {} 14 15func (*s) common() {} //@mark(sCommon, "common"),refs("common", sCommon, xCommon, yCommon, zCommon) 16 17func (*s) firstMethod() {} //@mark(sfMethod, "firstMethod"),refs("firstMethod", sfMethod, xfMethod, zfMethod) 18 19func (*s) secondMethod() {} //@mark(ssMethod, "secondMethod"),refs("secondMethod", ssMethod, ysMethod, zsMethod) 20 21func main() { 22 var x first = &s{} 23 var y second = &s{} 24 25 x.common() //@mark(xCommon, "common"),refs("common", firCommon, xCommon, zCommon) 26 x.firstMethod() //@mark(xfMethod, "firstMethod"),refs("firstMethod", firMethod, xfMethod, zfMethod) 27 y.common() //@mark(yCommon, "common"),refs("common", secCommon, yCommon, zCommon) 28 y.secondMethod() //@mark(ysMethod, "secondMethod"),refs("secondMethod", secMethod, ysMethod, zsMethod) 29 30 var z *s = &s{} 31 z.firstMethod() //@mark(zfMethod, "firstMethod"),refs("firstMethod", sfMethod, xfMethod, zfMethod) 32 z.secondMethod() //@mark(zsMethod, "secondMethod"),refs("secondMethod", ssMethod, ysMethod, zsMethod) 33 z.common() //@mark(zCommon, "common"),refs("common", sCommon, xCommon, yCommon, zCommon) 34} 35