mirror of
				https://github.com/SourceFellows/gobuch.git
				synced 2025-11-04 07:36:19 +01:00 
			
		
		
		
	initial import
This commit is contained in:
		
							
								
								
									
										27
									
								
								hello-interface/main.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								hello-interface/main.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
package main
 | 
			
		||||
 | 
			
		||||
import "fmt"
 | 
			
		||||
 | 
			
		||||
type QuasselStrippe interface {
 | 
			
		||||
	Quassel()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type Person struct {
 | 
			
		||||
	name string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (p *Person) Quassel() {
 | 
			
		||||
	fmt.Printf("Hi. Meine Name ist %s\n", p.name)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func VielQuasseln(qs QuasselStrippe) {
 | 
			
		||||
	for i := 0; i < 3; i++ {
 | 
			
		||||
		qs.Quassel()
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func main() {
 | 
			
		||||
	s := &Person{name: "Quassel-Philip"}
 | 
			
		||||
	s.Quassel()
 | 
			
		||||
	VielQuasseln(s)
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user