Go interface method signatures సమితిని నిర్వచిస్తుంది — ఇది ఆচరణ యొక్క ఒక ఒప్పందం. కీలకంగా, interfaces 암묵적으로 సంతృప్తి చెందుతాయి: ఆ methods ఉన్న ఏదైనా type explicit "implements" declaration లేకుండా స్వయంచాలకంగా interface ని సంతృప్తిపరుస్తుంది. ఈ structural, duck-typing విధానం విశిష్టమైనది మరియు శక్తిశాలីనది.
Interface నిర్వచన మరియు implicit implementation
Speaker {
Speak()
}
Dog {}
Speak() { }
Cat {}
Speak() { }
s Speaker = Dog{}
s.Speak()
