如何在StreamWriter中使用Close()方法

In Go crypto\cipher package, type StreamWriter has a Close() method. From the implementation, it looks like just calling the underlying io.Writer's Close() method. My question is: is there any scenario that I should call this method instead of calling the Close() method of the underlying Writer directly?

No, calling StreamWriter's close method and calling the underlying writer's close method is exactly the same. It is only there so StreamWriter will implement the io.WriteCloser interface.

It is only because this method exists that the type can be used as an io.WriteCloser.