课程: Hands-On Introduction: Go

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Challenge 5: Working with interfaces

Challenge 5: Working with interfaces - Go教程

课程: Hands-On Introduction: Go

Challenge 5: Working with interfaces

- [Instructor] This challenge will help us implement a few interfaces to get more comfortable with them. It should be a fun one, buckle up. So we won't start from scratch though. We'll pull parts of the previous challenges solution to give us a head start and keep our focus on working with interfaces. If you open up the challenges/interfaces/begin/main folder or main file rather, you'll see that we have a doAnalysis function that's going to do the bulk of our work here. This is a variadic function. It takes in some strain data and a list of counters that must implement the counter interface. If we scroll up, we'll see what that looks like. Inside of the doAnalysis function, we're relying on the name method and the count method for each of the counters. The letterCounter, numberCounter and symbolCounter types, already pre declared here, will need to support the name and count methods. Your task is to ensure that these…

内容